Authentication
You will need to acquire access token to be able to use Wego's API. To request for a token, call the authentication endpoint with your client ID.
POST https://affiliate-api.wego.com/apps/oauth/token
{
"client_id": "<client id>",
"grant_type": "client_credentials",
"scope": "affiliate"
}
This will return a response with an access_token along with useful information.
Response
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGc...",
"token_type": "bearer",
"expires_in": 43199,
"scope": "affiliates",
"created_at": 1500000000
}
note
Your credentials should be kept private. Thus, you will have to acquire the access_token from your backend, and pass it onto the client.
Now, that you have access_token, we can start facilitating flights or hotels search for your users.