locked
Complete Device Bound Notification rest does not work for me RRS feed

  • Question

  • Hi all,
            I am calling REST call with php-curl to complete the device notification message referred from official doc. below is my code

    <?php

    $curl = curl_init();
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://MYHUBNAME.azure-devices.net/devices/MYDVCID/messages/deviceBound/DVCTAG?api-version=2018-06-30",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "DELETE",
      CURLOPT_POSTFIELDS => "",
      CURLOPT_HTTPHEADER => array(
        "Accept: application/json",
        "Authorization: MYSASTOKEN",
        "Cache-Control: no-cache",
        "Connection: keep-alive",
        "Host: MYHUBHOST",
        "UserAgent: Microsoft.Azure.Devices/1.17.2",
        "accept-encoding: gzip, deflate",
        "cache-control: no-cache",
        "content-length: "
      ),
    ));

    $response = curl_exec($curl);
    $err = curl_error($curl);

    curl_close($curl);

    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }


    In the response i am always getting the below json response

    {
      "Message": "{"errorCode":400004,"trackingId":"XXXXXXXXX-G:7-TimeStamp:XXXXXXXX","message":"BadRequest","timestampUtc":"XXXXXXXXX"}",
      "ExceptionMessage": ""
    }

    I tried alot to fix it but not getting the issue, please help me


    Thursday, May 16, 2019 1:23 PM

All replies

  • Hi Vishal,

    We will need to take a look at server side logs. 

    Can you please file a support request @ https://aka.ms/azsupt and reference this issue in the description? If you do not have access to a support plan, please reach out @ AZCommunity @ microsoft.com with a link to this Doc/Issue as well as your subscription ID and we can help get the support ticket opened for this issue.

    Thank you!

    Friday, May 17, 2019 9:51 AM