Authentication Using OAuth2.0

This API is used to generate OAuth token to use in all the iAutomate APIs if the Authentication type is OAuth2.0.

Generate OAuth Token

Purpose To generate OAuth token.
API URL https://<API URL>:<API Port>/token
Authentication type None
Method Type POST
Header "Content-Type", "application/x-www-form-urlencoded"
Body
Key Value Remarks
grant_type password Fixed value
username useremail API user email
password User password User password

Output:

{
 "Access_token": "XXXXXXXX ",
 "token_type": "bearer",
 "expires_in": 86399
}

Parameters Returned in Response of API

Column Column type Value Remarks
access_token string token This field provide token
token_type string bearer This field provide token_type
expires_in int time This field provide expire time (in Second)

Use of OAuth Token

Purpose To use OAuth Token to access iAutomate API.
API URL Any iAutomate API as mentioned in the section 1 , section 2 , section 3 , and section 4 .
Authentication type Bearer
Token value Token provided by upper API

Example:

 var client = new RestClient("http://<URL>:<Port>/iAutomateAPI/Request/GetIncidentTicketData/19");
client.Timeout = -1;
 var request = new RestRequest(Method.GET);
request. AddHeader ("Authorization", "Bearer XXXXXXXX ");