External services (deprecated) Follow
You might want to call external service from AuraPlayer.
The idea is , that all your service calls would be to AuraPlayer's ServiceManager.
Having one stop shop - All the client calls go to AuraPlayer ServiceManager.
The way o do it, is to call AuraPlayer's API - ExternalService.
The way to do that is:
POST with JSON contentType
http://<host>:<port>/ServiceManager/Macro/ExternalService
parameters:
externalUrl - Service URL
httpMethod [Optional] - Method to be executed by the ServiceManager (GET,POST,PUT, DELETE) - default is POST
contentType [Optional] - Content type of the Service to be executed - default is text/plain
headersToExternalService [Optional] - HTTP headers sent to the service, array of JSON objects.
data [Optional] - URI encoded data, using encodeURIComponent
query [Optional] - query string to perform Get
example body:
{
"externalUrl": "http://www.nytimes.com",
"httpMethod": "GET",
"contentType": "application/json; charset=utf-8",
"headersToExternalService":[
{"header1":"h1Value"}
{"header2":"h2Value"}
]
}
var jsonToSend = '{"MAIN_USERNAME_0":"MIA", "MAIN_PASSWORD_0":"ORACLE", "S_CUSTOMER_ID_0":"CA"}'
jsonToSend = encodeURIComponent(jsonToSend);
{
"externalUrl": "http://<host>:<port>/ServiceManager/Macro/ExecMacro/A_getCustomersList",
"httpMethod": "POST",
"contentType": "application/json; charset=utf-8",
"data" : jsonToSend,
"headersToExternalService":[
{"header1":"h1Value"},
{"header2":"h2Value"}
]
}
Comments
0 comments
Please sign in to leave a comment.