AnsweredAssumed Answered

PI Web API Call To Streamset controller is returning 'Bad Request'

Question asked by hmokdad on Dec 2, 2016
Latest reply on Dec 2, 2016 by Marcos Vainer Loeff

Hi, I am trying to get all the attributes with their values of a certain AF Element using the following request to PI Web API, https://myServer/piwebapi/streamsets/ElementWebId/value. Accessing the URL from the browser will get me the desired result, however, accessing it from my JavaScript code using the below method is returning 'Bad Request'. All other calls to other PI Web API Controllers other that 'Streamset' are working fine.


function GetJsonContent(url, SuccessCallBack, ErrorCallBack) {


        type: 'GET',

        url: url,

        cache: false,

        async: true,

        contentType: "application/json; charset=UTF-8",

        beforeSend: function (xhr) {

           xhr.setRequestHeader("Authorization", makeBasicAuth("administrator", "password"));


        success: SuccessCallBack,

        error: ErrorCallBack




Thanks for your help.

Note: I am using PI Web API 2015 R2.