GET login/users/:user id/groups

From Social ID Developers
Jump to: navigation, search

Contents

Description

Searches for Groups of a User.

Resource URL

  GET https://api.socialidnow.com/v1/marketing/login/users/:user_id/groups

Parameters

URL Parameters

user_id required user identifier.
group_id optional group identifier.
page optional page number (each page contains page_size results). Default: 1.
page_size optional maximum amount of results to be returned. Default: 8.

Authentication

This API requires Login App authentication. See Authentication.

Response

Response Status

ok (200) The request was successful.
unauthorized (401) The authentication is wrong. See Authentication.
forbidden (403) The account does not have access to this user.
internal_server_error (500) An unknown error happened.

Response Body

A successful search returns the following fields:

total total amount of user groups found.
offset amount of discarded user groups (page start).
count amount of user groups returned in this page.
results array with user group details:
created_at date when the user was added to the group.
group_id group identifier.
group group details. See response from GET groups/:group_id

Examples

Without search parameters

Request

curl -iX GET 'https://api.socialidnow.com/v1/marketing/login/users/10/groups' \
  --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf

Response

Response Headers
HTTP/1.1 200 Ok
Status: 200
Response Body
{
  "total": 30,
  "offset": 0,
  "count": 8,
  "results": [
    {
      "created_at": "2022-11-17T20:30:00Z",
      "group_id": 1,
      "group": {
        "id": 1,
        "name": "Group A",
        "category": "Category X",
        "description": "My Group A description",
        "child_group_ids": [10,20,30],
        "parent_group_ids": [30,40,50],
        "manager_group_ids": [60,70,80],
        "managed_group_ids": [90,100,110],
        "created_at": "2022-11-17T19:30:00Z",
        "updated_at": "2022-11-17T19:30:00Z"
      }
    },
    {
      "created_at": "2022-11-17T20:31:00Z",
      "group_id": 2,
      "group": {
        "id": 2,
        "name": "Group B",
        "category": "Category X",
        "description": "My Group B description",
        "child_group_ids": [],
        "parent_group_ids": [],
        "manager_group_ids": [],
        "managed_group_ids": [],
        "created_at": "2022-11-17T19:31:00Z",
        "updated_at": "2022-11-17T19:31:00Z"
      }
    },
    {
      "created_at": "2022-11-17T20:32:00Z",
      "group_id": 3,
      "group": {
        "id": 3,
        "name": "Group C",
        "category": "Category X",
        "description": "My Group C description",
        "child_group_ids": [],
        "parent_group_ids": [],
        "manager_group_ids": [],
        "managed_group_ids": [],
        "created_at": "2022-11-17T19:32:00Z",
        "updated_at": "2022-11-17T19:32:00Z"
      }
    },
    {
      "created_at": "2022-11-17T20:33:00Z",
      "group_id": 4,
      "group": {
        "id": 4,
        "name": "Group D",
        "category": "Category Y",
        "description": "My Group D description",
        "child_group_ids": [],
        "parent_group_ids": [],
        "manager_group_ids": [],
        "managed_group_ids": [],
        "created_at": "2022-11-17T19:33:00Z",
        "updated_at": "2022-11-17T19:33:00Z"
      }
    },
    {
      "created_at": "2022-11-17T20:34:00Z",
      "group_id": 5,
      "group": {
        "id": 5,
        "name": "Group E",
        "category": "Category Y",
        "description": null,
        "child_group_ids": [],
        "parent_group_ids": [],
        "manager_group_ids": [],
        "managed_group_ids": [],
        "created_at": "2022-11-17T19:34:00Z",
        "updated_at": "2022-11-17T19:34:00Z"
      }
    },
    {
      "created_at": "2022-11-17T20:35:00Z",
      "group_id": 6,
      "group": {
        "id": 6,
        "name": "Group F",
        "category": "Category Y",
        "description": null,
        "child_group_ids": [],
        "parent_group_ids": [],
        "manager_group_ids": [],
        "managed_group_ids": [],
        "created_at": "2022-11-17T19:35:00Z",
        "updated_at": "2022-11-17T19:35:00Z"
      }
    },
    {
      "created_at": "2022-11-17T20:36:00Z",
      "group_id": 7,
      "group": {
        "id": 7,
        "name": "Group G",
        "category": "Category Y",
        "description": null,
        "child_group_ids": [],
        "parent_group_ids": [],
        "manager_group_ids": [],
        "managed_group_ids": [],
        "created_at": "2022-11-17T19:36:00Z",
        "updated_at": "2022-11-17T19:36:00Z"
      }
    },
    {
      "created_at": "2022-11-17T20:37:00Z",
      "group_id": 8,
      "group": {
        "id": 8,
        "name": "Group H",
        "category": "Category Y",
        "description": null,
        "child_group_ids": [],
        "parent_group_ids": [],
        "manager_group_ids": [],
        "managed_group_ids": [],
        "created_at": "2022-11-17T19:37:00Z",
        "updated_at": "2022-11-17T19:37:00Z"
      }
    }
  ]
}

With search parameters

Request

curl -iX GET 'https://api.socialidnow.com/v1/marketing/login/users/10/groups?page_size=3&page=2' \
  --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf

Response

Response Headers
HTTP/1.1 200 Ok
Status: 200
Response Body
{
  "total": 30,
  "offset": 3,
  "count": 3,
  "results": [
    {
      "created_at": "2022-11-17T20:33:00Z",
      "group_id": 4,
      "group": {
        "id": 4,
        "name": "Group D",
        "category": "Category Y",
        "description": "My Group D description",
        "child_group_ids": [],
        "parent_group_ids": [],
        "manager_group_ids": [],
        "managed_group_ids": [],
        "created_at": "2022-11-17T19:33:00Z",
        "updated_at": "2022-11-17T19:33:00Z"
      }
    },
    {
      "created_at": "2022-11-17T20:34:00Z",
      "group_id": 5,
      "group": {
        "id": 5,
        "name": "Group E",
        "category": "Category Y",
        "description": null,
        "child_group_ids": [],
        "parent_group_ids": [],
        "manager_group_ids": [],
        "managed_group_ids": [],
        "created_at": "2022-11-17T19:34:00Z",
        "updated_at": "2022-11-17T19:34:00Z"
      }
    },
    {
      "created_at": "2022-11-17T20:35:00Z",
      "group_id": 6,
      "group": {
        "id": 6,
        "name": "Group F",
        "category": "Category Y",
        "description": null,
        "child_group_ids": [],
        "parent_group_ids": [],
        "manager_group_ids": [],
        "managed_group_ids": [],
        "created_at": "2022-11-17T19:35:00Z",
        "updated_at": "2022-11-17T19:35:00Z"
      }
    }
  ]
}
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox