Operations


As covered in Chapter 2 Section 1 “CRUD Operations”, the update operation can be accomplished using either the “PUT” or “POST” methods.

Not all API endpoints support “POST” and “PUT”. Refer to the API documentation for supported methods.


PUT

  • Updates only the key-value pairs sent in the payload; other configurations remain intact.

a. GET /api/v1/sites/:site_id/wlans/:object_id

{
    "id": "445c23ed-f8ec-cf05-24ea-64af335cb575",
    "name": "object name",
    "attr": "value",
    "object": {
        nested": true
    },
    "list": [ "value1", "value2" ]
}

b. PUT /api/v1/sites/:site_id/wlans/:object_id

Request Payload

{
    "name": "new object name",
    "object": {
        "nested": true,
        "updated": true
    }
}

Response

Status: 200 OK

{
    "id": "445c23ed-f8ec-cf05-24ea-64af335cb575",
    "name": "new object name",
    "attr": "value",
    "object": {
        "nested": true,
        "updated": true
    },
    "list": [ "value1", "value2" ]
}

POST

  • Replaces all existing configurations with the key-value pairs sent in the payload.

a. GET /api/v1/sites/:site_id/wlans/:object_id

{
    "id": "445c23ed-f8ec-cf05-24ea-64af335cb575",
    "name": "object name",
    "attr": "value",
    "object": {
        "nested": true
    },
    "list": [ "value1", "value2" ]
}

b. POST /api/v1/sites/:site_id/wlans/:object_id

Request Payload

{
    "name": "new object name",
    "list": [ "value3" ]
}

Response

Status: 200 OK

{
    "id": "445c23ed-f8ec-cf05-24ea-64af335cb575",
    "name": "new object name",
    "list": [ "value3" ]
}