How do a make a call to Azure Datamarket?

Nov 4, 2012 at 7:51 AM

Can anyone point me what I did wrong in the following snippet?
The Odata endpoints expects two parameters OrganizationName and State which I provided.
The response comes back saying that the params are not provided.

 var requestGetOrganization = {
        requestUri: "https://api.datamarket.azure.com/Data.ashx/DigitalTrowel/Powerlinx/v2/GetOrganizations",
        enableJsonpCallback: true,
        data: { OrganizationName: "Microsoft", State : "WA"},
        method: "GET",
        user: "myuser",
        password: "mypwd"
    };

     
     OData.request(requestGetOrganization,
  function (data, request) {
      var html = "";
      for (var i = 0; i < data.results.length; i++) {
          html += "
" + data.results[i].Name + "
"; } document.getElementById("target-element-id").innerHTML = html; }, OData.defaultError, undefined, OData.defaultHttpClient, OData.defaultMetadata);

 

Nov 15, 2012 at 7:21 PM

Hi Matadoor,

   Sorry for the delayed response. Can you share the network trace of the request and the response.  What is GetOrganization, is it a service operation? If that is the case then the arguments are passed as query parameters in the url:

    https://api.datamarket.azure.com/Data.ashx/DigitalTrowel/Powerlinx/v2/GetOrganizations?OrganizationName='Microsoft'&State='WA'

   Check this MSDN page for more details on them.

Regards,

Alex Trigo.