javascriptnode.jsfullcontact

getting 403 error(Fullcontact Api key contains non-hex characters )


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" }


Solution


  • 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.