<aside> <img src="notion://custom_emoji/22cdfe26-c4cc-4a90-b9fd-de1c57a561ac/14ed7cb3-d76c-809a-8bc2-007a409b7fa6" alt="notion://custom_emoji/22cdfe26-c4cc-4a90-b9fd-de1c57a561ac/14ed7cb3-d76c-809a-8bc2-007a409b7fa6" width="40px" /> TABLE OF CONTENTS
<aside> <img src="notion://custom_emoji/22cdfe26-c4cc-4a90-b9fd-de1c57a561ac/134d7cb3-d76c-8047-bfd3-007a2861e4d7" alt="notion://custom_emoji/22cdfe26-c4cc-4a90-b9fd-de1c57a561ac/134d7cb3-d76c-8047-bfd3-007a2861e4d7" width="40px" /> Viewtravel API V3 | To use the Viewtravel suite API you need to authenticate. For that you must use http or https AUTH and generate the token. The way to implement this functionality varies for each programming language. Viewtravel has two authentication methods
</aside>
This is a sample request by curl:
curl -d '{"username":"username","password":"password"}'
-H "Content-Type:application/json"
-X POST <https://content.view-travel.com/api/get-token-auth/>
If successful, this call will return a neatly packaged Token that you can user to make authenticated calls to API.
{
'token': '23c618d5becf741d264c8d92a61adfce9db6f43f'
}
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Token YOUR_TOKEN' ,
}
This is a sample request by curl.
curl -d '{"username":"username","password":"password"}'
-H "Content-Type:application/json"
-X POST <https://content.view-travel.com/api/token/>
It brings two tokens as a response:
{
"refresh": "eyJ0eXA...6rX5c",
"access": "eyJ0eX...W_sREqfLE4PE"
}
access => YOUR_TOKEN_ACCESS
refresh => YOUR_TOKEN_REFRESH)
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN_ACCESS',
}