Apex Code Development
Example Prompt:
Example Response:
Related Tasks:
Custom Object Creation
Example Prompt:
Example Response:
Related Tasks:
API Integration Setup
Example Prompt:
Example Response:
public class ExternalServiceIntegration {
private static final String BASE_URL = 'https://api.externalservice.com';
public static HttpResponse sendFeedback(String customerId, String feedback) {
HttpRequest req = new HttpRequest();
req.setEndpoint(BASE_URL + '/feedback');
req.setMethod('POST');
req.setHeader('Content-Type', 'application/json');
req.setBody(JSON.serialize(new Map{'customerId' => customerId, 'feedback' => feedback}));
Http http = new Http();
HttpResponse res = http.send(req);
return res;
}
}
Related Tasks:
Unit Test Creation
Example Prompt:
Example Response:
@isTest
private class ExternalServiceIntegrationTest {
@isTest
static void testSendFeedback() {
// Arrange
String customerId = '12345';
String feedback = 'Great service!';
Test.startTest();
// Act
HttpResponse response = ExternalServiceIntegration.sendFeedback(customerId, feedback);
// Assert
System.assertEquals(200, response.getStatusCode(), 'Expected HTTP status code 200');
// Additional assertions can be added based on the expected response body
Test.stopTest();
}
}
Related Tasks:
Technical Documentation Writing
Example Prompt:
Example Response:
Related Tasks: