出现 403 错误(Fullcontact Api 键包含非十六进制字符)
getting 403 error(Fullcontact Api key contains non-hex characters )
- 您好,我正在尝试更新 fullContact apiKey
- 我的新密钥是这种格式 ->
Wa**IuyqQZd****YhUiko**Asdc**POU
- 我的旧密钥是这种格式 ->
aq******982ad**s
- 我正在从 Node Js
调用 fullContact APi
ajax call :
var url = 'https://api.fullcontact.com/v2/person.json';
var data ={email:'abc@gmail.com',apiKey:'Wa**IuyqQZd****YhUiko**Asdc**POU'};
request({
method: 'GET',
url: url,
useQuerystring: true,
qs: data
},
function(error, response, body) {
//handling response here
if ((error || !response || response.statusCode > 400) && statusCode !== 404) {
console.log('Request to FullContact failed (status `' + statusCode + '`, time `' + time + '`):', data, error, body);
resolve(null);
return;
}
});
- 但是更新新密钥后出现错误
Request to FullContact failed (status 403
, time 1.467 sec
): {
email: 'abc@gmail.com', apiKey: 'Wa##IuyqQZdyu##YhUiko##AsdcPOU' }
null { "status":403, "message":"Api key contains non-hex characters or
is otherwise invalid" }
UPDATE
- 通过以下方式得到了答案
request({
method: 'GET',
url: url,
useQuerystring: true,
headers: {
"Authorization": "Bearer "+data.apiKey
},
qs: data,
}
as per recent documentation this need to pass ("Authorization": "Bearer "+data.apiKey) in header.
- 您好,我正在尝试更新 fullContact apiKey
- 我的新密钥是这种格式 ->
Wa**IuyqQZd****YhUiko**Asdc**POU
- 我的旧密钥是这种格式 ->
aq******982ad**s
- 我正在从 Node Js 调用 fullContact APi
ajax call :
var url = 'https://api.fullcontact.com/v2/person.json';
var data ={email:'abc@gmail.com',apiKey:'Wa**IuyqQZd****YhUiko**Asdc**POU'};
request({
method: 'GET',
url: url,
useQuerystring: true,
qs: data
},
function(error, response, body) {
//handling response here
if ((error || !response || response.statusCode > 400) && statusCode !== 404) {
console.log('Request to FullContact failed (status `' + statusCode + '`, time `' + time + '`):', data, error, body);
resolve(null);
return;
}
});
- 但是更新新密钥后出现错误
Request to FullContact failed (status
403
, time1.467 sec
): { email: 'abc@gmail.com', apiKey: 'Wa##IuyqQZdyu##YhUiko##AsdcPOU' } null { "status":403, "message":"Api key contains non-hex characters or is otherwise invalid" }
UPDATE
- 通过以下方式得到了答案
request({
method: 'GET',
url: url,
useQuerystring: true,
headers: {
"Authorization": "Bearer "+data.apiKey
},
qs: data,
}
as per recent documentation this need to pass ("Authorization": "Bearer "+data.apiKey) in header.