Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Calling Twitter api (authentication issue)

Hello! You pass Authorization as query parameter, not header. But it should be header. Here is more information https://getsatisfaction.com/apperyio/...

araskin3i
Posts: 0
Joined: Fri Dec 20, 2013 2:44 pm

Calling Twitter api (authentication issue)

Thanks. This makes sense. Can you please confrirm that I am passing in the headers correctly? I am not sure if it should be an array..

var params = {};

params.lat = Appery("labelLat").text();
params.long = Appery("labelLong").text();
params.accuracy = Appery("labelAccuracy").text();
params.query = encodeURI( Appery("searchbarTwitterPlace").val() );
params.granularity = "poi";

var authHeader = EncodeHelper.getHeader('https://api.twitter.com/1.1/geo/searc...', params);
var headersObj = {"Authorization": authHeader};

serviceTwitterSearchPlace.execute({data: params, headers:headersObj});

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Calling Twitter api (authentication issue)

HI Alon,

Yes, you pass the headers correctly.

araskin3i
Posts: 0
Joined: Fri Dec 20, 2013 2:44 pm

Calling Twitter api (authentication issue)

Thanks Katya. Unfortunately I am still get an authentication error though it is a different one this time (which I guess is kind of a good sign). I will debug in more detail tomorrow and report back what I have found...

Thanks again for your assistance.

Alon

Return to “Issues”