TuGo API Forums

General

RSS Feed

HTTP GET headers

  1. 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 2 years ago

    Tags

  2. zbak2 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

  3. vishnu mohan s2 years ago

    how to make it work on php

[ Page 1 of 1 ]