我正在尝试使用API创建Eventbrite事件,这是我的代码
var request = require('request');
var EVENTBRITE_API_URL = 'https://www.eventbriteapi.com/v3/';
var _token = '<TOKEN>';
var _event = {
"event.name.html": "TestEvent01",
"event.description.html": "TestEvent01",
"event.start.timezone": "America/Chicago",
"event.start.utc": "2018-02-10T18:00:00Z",
"event.end.timezone": "America/Chicago",
"event.end.utc": "2018-02-10T20:00:00Z",
"event.currency": "USD",
};
var request = require('request');
var _headers = {
'Authorization': 'Bearer ' + _token,
'Content-Type': 'application/x-www-form-urlencoded',
}
// Configure the request
var options = {
url: EVENTBRITE_API_URL + "events/",
method: 'POST',
headers: _headers,
form: _event,
};
request(options, function (error, response, body) {
if (!error) {
console.log(body);
}
});
它没有工作,我收到了以下回复:
{"status_code": 403, "error_description": "You do not have permission to access the resource you requested.", "error": "NOT_AUTHORIZED"}
有人可以在这里说明错误。提前谢谢!