Difference between revisions of "Groups"

From Advice Local Wiki
Jump to: navigation, search
(Updating a Group)
Line 93: Line 93:
  
  
{"name":"Test Group"}
+
{"name":"Test Group", "clients": [123456, 234567]
 +
}
 
</syntaxhighlight>
 
</syntaxhighlight>
  
"name" is the desired updated name you want to chnage to
+
"name" is the desired updated name you want to change to
 +
"clients" are the ids of the locations you wish to add to this group
  
 
=== Example Response ===
 
=== Example Response ===

Revision as of 11:49, 8 April 2024

Get All Groups

Get a list of all the groups created for this partner dashboard.

API Endpoint

https://p.lssdev.com/legacygroups

Example Request

POST /legacygroups HTTP/1.1
Host: p.lssdev.com
x-api-token: YOUR_API_KEY
Content-Type: application/json


{"name":"Test Group"}


Example Response

{
    "status": 200,
    "success": true,
    "error": null,
    "data": [
        {
            "partner": 760,
            "id": 1,
            "name": "Test Group",
            "count": 0,
            "createdAt": "2024-04-08T19:41:00.000Z",
            "updatedAt": "2024-04-08T19:41:00.000Z"
        }
    ],
    "total": 1
}

Create a Group

This allows you to start grouping client locations into groups that you manage.

API Endpoint

https://p.lssdev.com/legacygroups

Example Request

POST /legacygroups HTTP/1.1
Host: p.lssdev.com
x-api-token: YOUR_API_KEY
Content-Type: application/json


{"name":"Test Group"}

"name" is the name of the group you want to create

Example Response

{
    "status": 200,
    "success": true,
    "error": null,
    "data": {
        "name": "Test Group",
        "createdAt": "2024-04-08T19:41:00.474Z",
        "updatedAt": "2024-04-08T19:41:00.474Z",
        "partner": 760
    }
}


Updating a Group

This allows you to update a group or add location ids to a group.

API Endpoint

https://p.lssdev.com/legacygroups

Example Request

POST /legacygroups/:id HTTP/1.1
Host: p.lssdev.com
x-api-token: YOUR_API_KEY
Content-Type: application/json


{"name":"Test Group", "clients": [123456, 234567]
}

"name" is the desired updated name you want to change to "clients" are the ids of the locations you wish to add to this group

Example Response

{
    "status": 200,
    "success": true,
    "error": null,
    "data": {
        "name": "Test Group",
        "createdAt": "2024-04-08T19:41:00.474Z",
        "updatedAt": "2024-04-08T19:41:00.474Z",
        "partner": 760
    }
}