Get Access Token
curl --request POST \
--url https://omnicommerce.sg/api/v1/oauth/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data grant_type=client_credentials \
--data client_id=your-client-id-uuid \
--data client_secret=your-client-secretconst options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
grant_type: 'client_credentials',
client_id: 'your-client-id-uuid',
client_secret: 'your-client-secret'
})
};
fetch('https://omnicommerce.sg/api/v1/oauth/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omnicommerce.sg/api/v1/oauth/token"
payload = {
"grant_type": "client_credentials",
"client_id": "your-client-id-uuid",
"client_secret": "your-client-secret"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text){
"access_token": "<access_token>",
"token_type": "Bearer",
"expires_in": 3600
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "invalid_client",
"error_description": "<string>"
}OAuth
Get Access Token
Exchange client credentials for an access token using OAuth 2.0 client_credentials grant. Tokens are valid for 1 hour.
POST
/
api
/
v1
/
oauth
/
token
Get Access Token
curl --request POST \
--url https://omnicommerce.sg/api/v1/oauth/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data grant_type=client_credentials \
--data client_id=your-client-id-uuid \
--data client_secret=your-client-secretconst options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
grant_type: 'client_credentials',
client_id: 'your-client-id-uuid',
client_secret: 'your-client-secret'
})
};
fetch('https://omnicommerce.sg/api/v1/oauth/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omnicommerce.sg/api/v1/oauth/token"
payload = {
"grant_type": "client_credentials",
"client_id": "your-client-id-uuid",
"client_secret": "your-client-secret"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text){
"access_token": "<access_token>",
"token_type": "Bearer",
"expires_in": 3600
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "invalid_client",
"error_description": "<string>"
}Body
application/x-www-form-urlencodedapplication/json