Dear,
I am trying to create a custom connector for a third party API that uses a custom authentication method.
It basically needs two calls, one for getting an accesstoken, and one for getting the data (using the accesstoken). I don't know how I can implement this two-step flow in a custom connector.
The first call is:
curl --location --request POST 'https://thirdpartyurl.com/api/v2/users/me/login' \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'email=myemail@mydomain.com' \
--data-urlencode 'password=xxxxxxxxxxxxxxxxxxxxxxxxxxxx'
which returns a JSON:
{
"data": {
"serverTime": "xxxxx",
"accessToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"accessTokenExpiration": "xxxxxx",
"refreshToken": "xxxxxxxxxxxxxxxxxx",
"refreshTokenExpiration": "xxxxxxxxxxxxxxxxxxxxx",
"authType": "user"
}
}
the second call is:
curl --location --request GET 'https://thirdpartyurl.com/api/v2/data' \
--header 'Authorization: Bearer myaccesstokenfrompreviousrequest'
I have no idea how to setup this "custom" authentication model in the custom connector so I can call the "data" request so that it uses the other "authentication" request...
Are there any samples or specific tutorials available somewhere that explain this?
Thanks,
Koen