Authentication
- 1.
- 2.Request a Bearer token via the
/v1/auth
endpoint - 3.Provide the Bearer token in the
Authorization
header to access all endpoints
Reach via Discord to request a
client_id
and client_secret
to access the service.Use the script below to get a Bearer token for your
client_id
and client_secret
.var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
var urlencoded = new URLSearchParams();
urlencoded.append("client_id", "demo-user-external");
urlencoded.append("client_secret", "k^yf57yg27MKo2SnuzwX");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: urlencoded,
redirect: 'follow'
};
fetch("https://paymagicapi.com/v1/auth", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
API requests are authenticated using the Bearer Auth scheme. To authenticate a request, provide the Bearer token in the
Authorization
header of the request:curl -H "Authorization: Bearer <your_bearer_token>" https://paymagicapi.com/v1
Bearer tokens expire every 60 minutes so a new one needs to be generated.
Last modified 2mo ago