then, how to use Inventory/AddInventoryItems?
I tried this, but error comes cause unauthorized. plz help!
handlers.TestItem = function (args, context)
{
var headers = {
"X-EntityToken": context.GetEntityToken
};
var body = {
// Entity: args.Entity,
Item: args.Item,
Amount: args.Amount,
};
var url = "https://titleId.playfabapi.com/Inventory/AddInventoryItems";
var content = JSON.stringify(body);
var httpMethod = "Post";
var contentType = "application/json";
log.info(context);
// The pre-defined http object makes synchronous HTTP requests
var response = http.request(url, httpMethod, content, contentType, headers);
return { responseContent: response };
}
,then, how to use Inventory/AddInventoryItems?
I tried this. but a error comes cause unauthorize.
handlers.TestItem = function (args, context)
{
var headers = {
"X-EntityToken": context.GetEntityToken
};
var body = {
// Entity: args.Entity,
Item: args.Item,
Amount: args.Amount,
};
var url = "https://titleId.playfabapi.com/Inventory/AddInventoryItems";
var content = JSON.stringify(body);
var httpMethod = "Post";
var contentType = "application/json";
log.info(context);
// The pre-defined http object makes synchronous HTTP requests
var response = http.request(url, httpMethod, content, contentType, headers);
return { responseContent: response };
}
plz help!