Conduit REST API

Home Forums Conduit: AEP Model Conduit REST API

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #30044
    William Laing
    Participant

    Good Day –

    We have a customer use case where we need to configure LoRaWAN parameters at initial startup, for example, changing the LoRaWAN network mode.

    The GET works fine: GET https://127.0.01/api/loraNetwork/network

    However, when we try:

    POST https://127.0.01/api/loraNetwork/network?public=1

    or

    POST https://127.0.01/api/loraNetwork/network with a body of {“public”:1},

    we get:

    {
    “code”: 400,
    “error”: “Path [network] does not lead to an array”,
    “status”: “fail”
    }

    Any help will be appreciated!

    Thanks,
    William

    #30045
    Jason Reiss
    Keymaster

    In a REST API POST is used to create a resource, i.e. add an item to an array.

    To change an existing resource, such as the network collection, PUT should be used.

    curl 127.0.0.1/api/loraNetwork/network -X PUT -H "Content-Type: application/json" -d '{"public":1}'

    #30046
    William Laing
    Participant

    Oops – I realized the mistake after I posted.

    Thanks again!
    William

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.