Difference between revisions of "Groups"

From Advice Local Wiki
Jump to: navigation, search
(Created page with "== Create a Group == This allows you to start grouping client locations into groups that you manage. === API Endpoint === <syntaxhighlight lang="html"> http://p.lssdev.com/le...")
 
(Get All Groups)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
== Get All Groups ==
 +
Get a list of all the groups created for this partner dashboard.  The query parameter ?populate=clients will include an array of the clients that belong to this group.  However, it should be noted that the request may become very large as the parent request is obligated to expand the one-to-many relationship.
 +
 +
=== API Endpoint ===
 +
<syntaxhighlight lang="html">
 +
https://p.lssdev.com/legacygroups?populate=clients
 +
</syntaxhighlight>
 +
 +
=== Example Request ===
 +
<syntaxhighlight lang="php">
 +
POST /legacygroups HTTP/1.1
 +
Host: p.lssdev.com
 +
x-api-token: YOUR_API_KEY
 +
Content-Type: application/json
 +
 +
 +
{"name":"Test Group"}
 +
</syntaxhighlight>
 +
 +
 +
 +
=== Example Response ===
 +
<syntaxhighlight lang="json">
 +
{
 +
    "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
 +
}
 +
</syntaxhighlight>
 +
 
== Create a Group ==
 
== Create a Group ==
 
This allows you to start grouping client locations into groups that you manage.
 
This allows you to start grouping client locations into groups that you manage.
Line 4: Line 45:
 
=== API Endpoint ===
 
=== API Endpoint ===
 
<syntaxhighlight lang="html">
 
<syntaxhighlight lang="html">
http://p.lssdev.com/legacygroups
+
https://p.lssdev.com/legacygroups
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 19: Line 60:
  
 
"name" is the name of the group you want to create
 
"name" is the name of the group you want to create
 +
 +
=== Example Response ===
 +
<syntaxhighlight lang="json">
 +
{
 +
    "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
 +
    }
 +
}
 +
</syntaxhighlight>
 +
 +
 +
== Updating a Group ==
 +
This allows you to update a group or add location ids to a group.
 +
 +
=== API Endpoint ===
 +
<syntaxhighlight lang="html">
 +
https://p.lssdev.com/legacygroups
 +
</syntaxhighlight>
 +
 +
=== Example Request ===
 +
<syntaxhighlight lang="php">
 +
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]
 +
}
 +
</syntaxhighlight>
 +
 +
"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 ===

Latest revision as of 11:51, 8 April 2024

Get All Groups

Get a list of all the groups created for this partner dashboard. The query parameter ?populate=clients will include an array of the clients that belong to this group. However, it should be noted that the request may become very large as the parent request is obligated to expand the one-to-many relationship.

API Endpoint

https://p.lssdev.com/legacygroups?populate=clients

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
    }
}