3 Replies Latest reply on Jan 6, 2018 9:31 AM by emile.senga

    Pulling my profile from Jive API

    theycallmeflowz

      Im trying to pull my profile info from the JIVE API using javaScript

      and i keep getting the error message "SyntaxError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': 'Authorization:' is not a valid HTTP header field name."
      in the Chrome Console.

       

      Heres my code

       

       

      var queryURL = "https://community.jivesoftware.com/api/core/v3/people/@me";

       


        $.ajax({

         url: queryURL,

         beforeSend: function(xhr) {

         xhr.setRequestHeader("Authorization:", "myUsername myPassword");

        },

         type: 'GET',

         dataType: 'json',

         contentType: 'application/json',

         success: function (response) {

         console.log(response);

        },

         error: function(error){

         console.log(error)

        }

      });

       

       

      Thanks.