I am trying to send a GET request to pull country information and I am getting a 403 error when I set the headers. I am using angularJS to build the request like so,
exports.getMessages = function () { return $http({ url:'https://api.tugroup.com/v1/travelsafe/countries/ar', headers: { 'X-Auth-Token': 'myKey'}, method: 'GET' }).success(function(data){ return data; }); };
returns this message GET https://api.tugroup.com/v1/travelsafe/countries/ar 403 (Forbidden)
Is there another header that needs to be added?
Message edited by dannychoi 8 years ago
zbak – 8 years ago
Hi dannychoi,
You are getting that response because the header parameter is incorrect. Instead of using "X-Auth-Token", you should use "X-Auth-API-Key".
Please see the example curl request that is provided in the documentation, or check out or IO docs for an interactive example.
Thanks, Zareef
vishnu mohan s – 8 years ago
how to make it work on php
Please sign in to add a post.
I am trying to send a GET request to pull country information and I am getting a 403 error when I set the headers. I am using angularJS to build the request like so,
exports.getMessages = function () { return $http({ url:'https://api.tugroup.com/v1/travelsafe/countries/ar', headers: { 'X-Auth-Token': 'myKey'}, method: 'GET' }).success(function(data){ return data; }); };
returns this message GET https://api.tugroup.com/v1/travelsafe/countries/ar 403 (Forbidden)
Is there another header that needs to be added?
Message edited by dannychoi 8 years ago
Tags
zbak – 8 years ago
Hi dannychoi,
You are getting that response because the header parameter is incorrect. Instead of using "X-Auth-Token", you should use "X-Auth-API-Key".
Please see the example curl request that is provided in the documentation, or check out or IO docs for an interactive example.
Thanks, Zareef
vishnu mohan s – 8 years ago
how to make it work on php