aaS fulfillment API gives 403

2022-02-25T04:17:55.477+00:00

SaaS fulfillment API gives 403 with

I'm generating authorization token like this

var axios = require('axios');
var qs = require('qs');
var data = qs.stringify({
'client_id': 'xxx',
'client_secret': 'xxxx',
'resource': '20e940b3-4c77-4b0b-9a53-9e16a1b010a7',
'grant_type': 'client_credentials'
});
var config = {
method: 'get',
url: 'https://login.microsoftonline.com/xxxx/oauth2/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);
});

Note: im using same appId given in offer config page

And i'm trying to call resolve api like this using above response

var resolveconfig = {
method: 'get',
url: resolve_url,
headers: {
'x-ms-marketplace-token': decodeURIComponent("token form landing page url"),
'authorization': Bearer ${response.data.access_token},
'x-ms-correlationid': 'xxx',
'x-ms-requestid': 'xxx',
'content-type': 'application/json'
}
};
const resolveResponse = await axios(resolveconfig)

but this api fails with 403

"The authorization token is invalid, expired, missing or this request is attempting to access a SaaS subscription for an offer that was published with a different Azure AD App ID from the one used to create the authorization token. Please make sure the authorization token is created using the same Azure AD App ID as the Azure AD App ID Id set for the offer in Technical Details tab in Partner Center."

please help

Microsoft Partner Center API
Microsoft Partner Center API
Microsoft Partner Center: A Microsoft website for partners that provides access to product support, a partner community, and other partner services.API: A software intermediary that allows two applications to interact with each other.
312 questions
0 comments No comments
{count} votes