This get Endpoint should deliver latest versions of Endpoints for different functions.
So static JSON response should be at the moment:
{
"latest": [
{
"getCustomerOverview": {
"method": "GET",
"path": "0.1/customer/"
},
"getCustomerById": {
"method": "GET",
"path": "0.1/customer/{{ACCOUNT_ID}}/"
},
"getSubscriptionsByCustomerId": {
"method": "GET",
"path": "0.1/customer/{{ACCOUNT_ID}}/subscriptions/"
},
"getSubscriptionOverview": {
"method": "GET",
"path": "0.1/subscription/"
},
"getSubscriptionById": {
"method": "GET",
"path": "0.1/subscription/{{SUBSCRIPTION_ID}}/"
}
}
]
}
I shall be grateful to you for your kind cooperation.
Thanks and regards
4 respostas
here i put several mapping url in string like this you mean:
@RestResource(urlMapping='/0.1/')
global with sharing class API_Version_1 {
@HttpGet
global static void getSubs() {
RestRequest request = RestContext.request;
List<string> GET = New List<string>{'customer/','customer/{accountId}/','customer/{accountId}/subscriptions/','subscription/','subscription/{subscriptionId}'};
Map<string,Object> Mapp = new Map<String,Object>();
Mapp.put('get',GET);
RestResponse res = RestContext.response;
res.responseBody = blob.valueOf(json.serialize(Mapp));
}
}