Skip to content

Instantly share code, notes, and snippets.

@shivasurya
Last active July 3, 2020 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shivasurya/685467bcde68ec7b092690a4138d678b to your computer and use it in GitHub Desktop.
Save shivasurya/685467bcde68ec7b092690a4138d678b to your computer and use it in GitHub Desktop.
var axios = require('axios');
var qs = require('qs');
var data = qs.stringify({
'jsonString': '{\n "email" : "srm@gmail.com",\n "role" : "admin",\n "first_name" : "Srirama Moorthy",\n "last_name":"Srm"\n}'
});
var config = {
method: 'post',
url: 'https://api.goschedule.io/users/inviteuser',
headers: {
'X-API-KEY': 'gsid=s%3ADbdXXXXXXXXXXXXXXXXXXXXXXYI5y3kNGxyXcVQqFdHR%2FmAdCh1cM4j1JtcEANILrV2w;',
'X-ORGANIZATION-ID': '449',
'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);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment