Obtain 24-hour Access Token
Once you get the authorization code, you can redeem 24-hour access token with the following API.
Body
clientIdstringRequired
Client ID obtained from the Cream Portal.
clientSecretstringRequired
Client Secret obtained from the Cream Portal.
authorizationCodestringRequired
Authorization code obtained after the Sign In with Cream.
Responses
200Success
application/json
post
POST /api/v1/ext/auth/oauth/accesstoken HTTP/1.1
Host: app.creamsolution.io
Content-Type: application/json
Accept: */*
Content-Length: 198
{
"clientId": "Client ID Obtained from Cream Portal",
"clientSecret": "Client secret Obtained from Cream Portal",
"authorizationCode": "EXTmxyoHPk9ICVX0LozILS6vdCIg1KSxz9I33ruDPLNR/RR2dHkFBPpypT3A3rwmOL"
}
200Success
{
"status": true,
"code": "AUTH_000",
"data": {
"accessToken": "CRURbm9KzT0qwGh7Vf0gHpNZJf598C+J9vtsnuzvGj1qvgujzlVw982YrP9kWrrx2tPqlPCO323sir/iXADQD30w=="
}
}
Once you obtain the access token, you should put the access token at the Authorization Header (Starting with Bearer) of every Graph API.
To test the Graph API, please try this /me endpoint.
const { data: { data: userprofile } } = await Axios.get('https://app.creamsolution.io/oapi/v1/me', {
headers: {
Authorization: 'Bearer ' + accessToken,
}
});
You should be able to obtain the profile of the logged in user.
Last updated