Page History
...
Code Block | ||
---|---|---|
| ||
API customers.GET
jsonResource = HTTP_Resource_Services('GetDatabaseItems', '', 'CUSTOMERS', FullEndpointURL, 'FIRST_NAME' : @FM : 'LAST_NAME', 'firstName' : @FM : 'lastName')
If Error_Services('NoError') then
// Set the response body with the serialized JSON object and set the Content-Type response header.
HTTP_Services('SetResponseBody', jsonResource, False$, 'application/hal+json')
end else
// There is an error condition so call the SetResponseError service.
HTTP_Services('SetResponseError', '', '', 500, Error_Services('GetMessage'), FullEndpointURL)
end
end api |
This approach doesn't provide a way to customize the name of the embedded resource (e.g., customers, vendors, etc.). Instead, it just defaults to item. Here is an example of the resource object:
...