Use our API to build a custom integration to supercharge your loyalty marketing program
Authorization
Get a User
- You will need a user with access to your Marsello account.
- This only works with users that have access to exactly one Marsello account.
- To create new users for use with the API please invite them inside Marsello Dashboard > Settings > Users
Get a token
Replace with your details and run the command or import into Postman.
Use the following client id: ea711d08-01a1-4c12-957e-9a26809372ed.
Use your username and password.
Curl
curl --location --request POST 'https://marselloexternal.b2clogin.com/marselloexternal.onmicrosoft.com/B2C_1_ROPC/oauth2/v2.0/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'scope=https://dev.marsello.com/scope/write.all https://dev.marsello.com/scope/read.all' \
--data-urlencode 'username=**YOUR USERNAME**' \
--data-urlencode 'password=**YOUR PASSWORD**' \
--data-urlencode 'client_id=ea711d08-01a1-4c12-957e-9a26809372ed'
Javascript(Axios)
var axios = require('axios');
var qs = require('qs');
var data = qs.stringify({
'grant_type': 'password',
'scope': 'https://dev.marsello.com/scope/write.all https://dev.marsello.com/scope/read.all',
'username': '**YOUR USERNAME**',
'password': '**YOUR PASSWORD**',
'client_id': 'ea711d08-01a1-4c12-957e-9a26809372ed'
});
var config = {
method: 'post',
url: 'https://marselloexternal.b2clogin.com/marselloexternal.onmicrosoft.com/B2C_1_ROPC/oauth2/v2.0/token',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Use the token
For all requests you will need to add an Authorization header to each request with this token.
Authorization: Bearer **your token goes here**
Test your queries in the browser below by clicking the Authorize button then try the requests.