Question

I am trying to use the Gracenote web API to register a new user as specified in the documentation here https://developer.gracenote.com/creating-new-app

Here is my function that I am using

function registerApp(){
    var xml='<QUERIES><QUERY CMD="REGISTER"><CLIENT>xxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</CLIENT></QUERY></QUERIES>';

    xmlDoc=$.parseXML(xml);
    $.ajax({
        url:"https://cxxxxxxxx.web.cddbp.net/webapi/xml/1.0/",
        processData:false,
        data:xmlDoc
    });
}

however I am getting the following response

<RESPONSES>
    <MESSAGE>Invalid CLIENT / USER information.</MESSAGE>
    <RESPONSE STATUS="ERROR" />
</RESPONSES>

Can anyone see what I am doing wrong?

Was it helpful?

Solution

I was being very stupid indeed. The jquery ajax method defaults the type to a GET as soon as I changed it to POST it worked fine

function registerApp(){
var xml='<QUERIES><QUERY CMD="REGISTER"><CLIENT>xxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</CLIENT></QUERY></QUERIES>';

xmlDoc=$.parseXML(xml);
$.ajax({
    type: "POST",
    url:"https://cxxxxxxxx.web.cddbp.net/webapi/xml/1.0/",
    processData:false,
    data:xmlDoc
});

}

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top