callGetMethod
Runs an HTTP Get request and returns the HTTP response from the server.
Syntax
Copy
function callGetMethod(url : string, obj : any, timeout : number, additionalHeaders : any, certificate : WorkflowClientCertificate): IFtosHttpResult;
| Parameter | Type | Description |
|---|---|---|
url
|
string | The service endpoint's URI. For instance, the address of a REST API endpoint. |
obj optional |
any | Key-value pairs in JSON format to be passed in the request's body. |
timeout optional |
number | Maximum number of seconds to wait for the HTTP response. |
additionalHeaders optional |
any | Key-value pairs in JSON format to be passed in the request's custom headers. |
certificate optional |
WorkflowClientCertificate | Registered client certificate required for client authentication via TLS/SSL. For information on how to register client certificates, see the Innovation Core documentation. For information on how to retrieve a registered client certificate, see server.clientCertificates.get. |
Return Value
Returns the HTTP response in a JSON object.
Copy
{
isSuccess : boolean;
message? : string;
response : any;
statusCode : number
}
For example:
Copy
{
"IsSuccess": true,
"Response": "{\"access_token\":\"381e2619-96af-4e75-a550-d5d66ecec7a6\",\"expires_in\":1200.0,\"email\":\"host@change.me\",\"error\":null}",
"StatusCode": 200
}
NOTE
The
The
Response key in the result is a string, not a JSON object as when using the httpGet function.Examples
In this example:
- We issue a Get API request to the https://www.fintechos.com/Studio/api/authorize/GetToken endpoint.
- We provide the id, username, password, and response_type parameters in the request's URL.
- We save the HTTP response in a variable called response.
var response = callGetMethod('https://www.fintechos.com/Studio/api/authorize/GetToken?client_id=123&username=host&password=1234567&response_type=token');