Skip to content

POST Auth ​

https://api.magmasend.com/v1/oauth/login

Magmasend API requires an Access token, based on your credentials (email and password).

  • You will use this token to consume all other endpoints.

  • You can use the same token for many API calls. As long as the token has not expired, it will work.

  • A best practice is to use the same token until it expires.

Request Information ​

To obtain an Access token, you need to provide your email and password. Once authenticated, you will receive a token that you can use for subsequent API requests.

Make sure to handle the token securely and avoid exposing it in your code or logs.

Exemple of a body, raw (json) ​
json

{
    "email": "developer@develop.com",
    "password": "developer"
}

Example Request ​

NodeJs-Request

cvar request = require('request');
var options = {
  'method': 'POST',
  'url': 'BASEURL/v1/oauth/login',
  'headers': {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "email": "hello@email.com",
    "password": "hello-dolly"
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

Example Response ​

json

{
    "code": "00",
    "status": "OK",
    "access_token": "TOKEN_XXXXXXXXX",
    "token_type": "bearer",
    "expires_in": 86400
}