<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>

Authentication Basic

Overview


1. Get Token

2. Include the following headers in the requests:

headers: {
	'Content-Type': 'application/json',
	'Accept': 'application/json',
	'Authorization': 'Token YOUR_TOKEN' ,
}

Authentication JWT

1. Get 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)

2. Include the following headers in the requests:

headers: {
	'Content-Type': 'application/json',
	'Accept': 'application/json',
	'Authorization': 'Bearer YOUR_TOKEN_ACCESS',
}