I need some pointers for anybody who has used HTTPAPI to work with OAUTH2.
I need to work with OAUTH2 to get the token before processing further requests.
So what I need to do is:
1.) Get a token from a given URL using client id and secret
Information from the vendor:
Code: Select all
curl --request POST --url https://xxxxx-xxx.xxxxi.xx/xxx/xxxxx/oauth/v2/token --header 'content-type: application/x-www-form-urlencoded' --data grant_type=client_credentials --data client_id=<your_client_id> --data client_secret=<your_client_secret>
Code: Select all
{"access_token": "<a_valid_token>", "token_type": "Bearer", "expires_in": 3600}
Code: Select all
rc = http_req( 'POST'
:'https://xxxxx-xxx.xxxxi.xx/xxx/xxxxx/oauth/v2/token'
: *omit
: resultStr // String to receive the results
: *omit
: 'grant_type=client_credentials'
: 'application/x-www-form-urlencoded');
2.) Make use of the token for further processing
What I am struggling with at the moment is the calls I need to make to a.) get the token and b.) how to make use of the token in the program.
IS there anybody kind enough to give me some pointers on what processes I need to call to just get the token and then set the token up to be used.
Many thanks all