$http key and secret format for GET

15 views
Skip to first unread message

Steffen M

unread,
May 11, 2016, 4:25:59 PM5/11/16
to AngularJS
I am a noob to angular and JS in general, but am trying to figure out how to format a GET request to a map service with key and secret.  Just cant seem to get it.  could somebody help me out with the below request format?

$scope.setNotification = function() {
        $http({
          method: 'GET',
          Key: 'F66FBC07B7424DDC89SS',
          Secret: 'A5F4EA6858944E56BCBE8C547B4BB2B7'
        }).then(function successCallback(response) {
          }, function errorCallback(response) {
          });
        };

Gabriele Ciech

unread,
May 11, 2016, 5:01:21 PM5/11/16
to AngularJS
FIrst of all: do not share your own keys and password for accessing api!

Now to your problem, your question is not very clear, I'm assuming that Key and Secret are two parameters that needs to be send to the server.
$scope.setNotification = function() {
       $http({
         method: 'GET',
         url: 'https://api.urthecast.com/v1/consumers/apps/me/aois/5zyx3fEfSPy7zZrBepZF5A',
         config
: {
             
params: {
                 'Key': 'F66FBC07B7424DDC89SS',
                 'Secret': 'A5F4EA6858944E56BCBE8C547B4BB2B7'
            }
         
}
         
        }).then(function successCallback(response) {
         }, function errorCallback(response) {
         });
       };

Documentation: https://docs.angularjs.org/api/ng/service/$http argument section

Steffen M

unread,
May 11, 2016, 5:33:31 PM5/11/16
to ang...@googlegroups.com
still no joy.  getting the following error from this post:

$scope.setNotification = function() {
        $http({
          method: 'GET',
            config: {
              params: {
                api_key: 'key',
                api_secret: 'secret'
              }
            }
        }).then(function successCallback(response) {
          }, function errorCallback(response) {
          });
        };

--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/RbxtwieAvBI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages