Get an access token (OAuth client credentials)
curl --request POST \
--url https://api.v3.andteam.com/v1/oauth/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data grant_type=client_credentials \
--data 'tenant=<string>'import requests
url = "https://api.v3.andteam.com/v1/oauth/token"
payload = {
"grant_type": "client_credentials",
"tenant": "<string>"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({grant_type: 'client_credentials', tenant: '<string>'})
};
fetch('https://api.v3.andteam.com/v1/oauth/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.v3.andteam.com/v1/oauth/token"
payload := strings.NewReader("grant_type=client_credentials&tenant=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"access_token": "<string>",
"token_type": "Bearer",
"expires_in": 123,
"scope": "<string>"
}Authentication
Get an access token (OAuth client credentials)
For an app registered with andteam and installed by a tenant’s admin. Send grant_type=client_credentials, tenant (the tenant’s andteam subdomain, such as acme) and the app’s client_id and client_secret (in the body or as HTTP Basic). The token is valid for one hour and is sent as Authorization: Bearer ato_…; it carries the install’s companies and field groups. Errors are RFC 6749 JSON (error, error_description), not problem details.
POST
/
oauth
/
token
Get an access token (OAuth client credentials)
curl --request POST \
--url https://api.v3.andteam.com/v1/oauth/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data grant_type=client_credentials \
--data 'tenant=<string>'import requests
url = "https://api.v3.andteam.com/v1/oauth/token"
payload = {
"grant_type": "client_credentials",
"tenant": "<string>"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({grant_type: 'client_credentials', tenant: '<string>'})
};
fetch('https://api.v3.andteam.com/v1/oauth/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.v3.andteam.com/v1/oauth/token"
payload := strings.NewReader("grant_type=client_credentials&tenant=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"access_token": "<string>",
"token_type": "Bearer",
"expires_in": 123,
"scope": "<string>"
}Body
application/x-www-form-urlencoded