Suggested answer

Apex REST resources are created using the @RestResource(urlMapping='/myresource/*') class annotation. Methods use HTTP verb annotations: @HttpGet (read), @HttpPost (create), @HttpPut (upsert), @HttpPatch (partial update), @HttpDelete. Access request/response via RestContext.request and RestContext.response. The request body is in RestContext.request.requestBody (a Blob — deserialise with JSON.deserialize()). Path parameters: access via RestContext.request.requestURI. Return values from @HttpGet methods are automatically serialised to JSON. Authentication: external systems call via OAuth 2.0 (Connected App). URL: https://instance.salesforce.com/services/apexrest/myresource/. Versioned resources: use URL mapping to version: /v1/myresource/*.

Practice content for interview preparation; not an official vendor answer. Verify details against current product documentation.

Community comments (0)

No comments yet.

Sign in or create a free account to add a comment. Comments are moderated before they appear.

Plain text only, 3–2000 characters. A moderator reviews every comment before it is published.