Difficulties with using the API


#1

Hello we are a group of interns who got a mission to implement payger into our App Marketplace. Be we are struggeling with getting the acces_token. We created a new account for testing but we are not able to create a merchant account as we dont have a buisness. Is it possible to use PaygerAPI just to send money from one user to another ?

We have this code for getting the acces_token :

var request = require(“request”);

var options = { method: ‘POST’,
url: ‘https://merchants-api.payger.com/api/v1/oauth/token’,
headers:
{
‘Content-Type’: ‘application/x-www-form-urlencoded’,
Authorization: 'basic '+ Buffer.from(“ourUsername:ourPassword”).toString(“base64”),
“Cache-Control”: “no-cache”
},
formData:
{ grant_type: ‘password’,
username: ‘ourUsername’,
password: ‘ourPassword’ } };

request(options, function (error, response, body) {
if (error) throw new Error(error);

console.log(body);
});

But as a response we get error: Full authentication is required to access this resource.
What are we doing wrong ?
Thanks for any help.