locked
update notification hub rest api RRS feed

  • Question

  • I want to update a notification hub.

    https://msdn.microsoft.com/en-us/library/azure/dn223260.aspx

    I can create a notification hub.

    But when I update a notification hub with a GcmCredential or others , I got conflict.

    requestURI = string.Format("https://{0}.servicebus.windows.net/{1}?api-version=2015-01", strNamespace, strNotiHub);

    request.method = "PUT"    return conflict

    request.method = "POST"   return not found

     string requestBody = ("<?xml version=\"1.0\" encoding=\"utf-8\"?>"
                                           +"<entry xmlns=\"http://www.w3.org/2005/Atom\">"
                                           +"<content type=\"application/xml\"><NotificationHubDescription>"
                                           +"<GcmCredential><Properties><Property><Name>GoogleApiKey</Name>"
                                           +"<Value>XXXXXXXXXXX</Value>"
                                           +"</Property></Properties></GcmCredential>"
                                           +"</NotificationHubDescription></content></entry>");

    Is my requestURI or requestBody wrong?

    Thank you

    Wednesday, April 13, 2016 10:36 AM

Answers

  • Could you make sure that you set the If-Match header to "*" value with PUT request.

    Thanks,

    Sateesh


    Mark Post as helpful if it provides any help.Otherwise,leave it as it is.

    • Marked as answer by Evan_Que Thursday, April 14, 2016 5:34 AM
    Wednesday, April 13, 2016 5:40 PM

All replies

  • Could you make sure that you set the If-Match header to "*" value with PUT request.

    Thanks,

    Sateesh


    Mark Post as helpful if it provides any help.Otherwise,leave it as it is.

    • Marked as answer by Evan_Que Thursday, April 14, 2016 5:34 AM
    Wednesday, April 13, 2016 5:40 PM
  • Yes.

    Thank you.

    Thursday, April 14, 2016 5:42 AM