Skip to content

Getting user data

User data can be exported to XLSX sheet in client panel or listed through API returning a paginated list of user-data.

GET /users/user-data/?filter[venue]=VENUE_ID&page[number]=1&page[size]=20&sort=-last_visit_on
curl \
  -H "Authorization: Bearer ${API_TOKEN}" \
  -H "Accept: application/vnd.api+json" \
  "https://api.socialwifi.com/users/user-data/?filter\[venue\]=VENUE_ID&page\[number\]=1&page\[size\]=20&sort=-last_visit_on" \
  | jq
GET /users/project-user-data/?filter[project]=PROJECT_ID&page[number]=1&page[size]=20&sort=-last_visit_on
curl \
  -H "Authorization: Bearer ${API_TOKEN}" \
  -H "Accept: application/vnd.api+json" \
  "https://api.socialwifi.com/users/project-user-data/?filter\[project\]=PROJECT_ID&page\[number\]=1&page\[sizer]=20&sort=-last_visit_on" \
  | jq

Available filters

Key Example Description
sort ?sort=-last_visit_on Sorts the list ascending/descending based on given field

Available sort fields are:

  • first_name/-first_name
  • last_name/-last_name
  • email/-email
  • phone/-phone
  • has_whatsapp/-has_whatsapp
  • birth_date/-birth_date
  • visits_count/-visits_count
  • first_visit_on/-first_visit_on
  • last_visit_on/-last_visit_on

Pagination filters

The list is paginated due to large amount of data it has to pull. If you want the full list you will have to go through multiple requests:

Key Example
page[number] page[number]=1
page[size] page[size]=20

Do not use large page sizes or the endpoint will not return data in time.

The JSON response will have pagination data under links key but for this very endpoint pagination generation have been disabled due to performance limitations. You will have to go over pages until you get less records than page size.

Response
{
  "data": [
    {
      "type": "user-datas",
      "id": "c11bf8f2-5745-48e8-a47a-1ddaa7739316",
      "attributes": {
        "email": "oolson@lyons.com",
        "email-confirmed": true,
        "last-exported-at": "2021-03-15T12:39:27.261293+00:00",
        "first-visit-on": null,
        "gender": "male",
        "last-visit-on": null,
        "visits-count": 0,
        "first-name": "Rebecca",
        "phone-confirmed": false,
        "has-whatsapp": false,
        "phone": null,
        "birth-date": "2021-03-15",
        "language": "English",
        "is-subscribed": true,
        "last-name": "Johnson",
        "user-id": "42c37979-956a-405c-8941-4141da93dac5"
      },
      "relationships": {
        "venue": {
          "data": {
            "type": "venues",
            "id": "22222222-2222-2222-2222-222222222222"
          }
        }
      }
    },
    {
      "type": "user-datas",
      "id": "c5432a19-73a8-476d-bf70-5c77c55b3077",
      "attributes": {
        "email": "hartryan@mitchell.org",
        "email-confirmed": true,
        "last-exported-at": "2021-03-15T12:39:27.261293+00:00",
        "first-visit-on": "2021-03-15T12:39:27.261295+00:00",
        "gender": "male",
        "last-visit-on": "2021-03-15T12:39:27.261296+00:00",
        "visits-count": 22,
        "first-name": "Kristen",
        "phone-confirmed": false,
        "has-whatsapp": false,
        "phone": null,
        "birth-date": "2010-08-11",
        "language": "English",
        "is-subscribed": true,
        "last-name": "Tucker",
        "user-id": "1d3105cf-1a3d-418f-9fed-f0b0f0eaa218"
      },
      "relationships": {
        "venue": {
          "data": {
            "type": "venues",
            "id": "22222222-2222-2222-2222-222222222222"
          }
        }
      }
    }
  ],
  "links": {
    "self": "http://api.socialwifi.com/users/user-data/?filter[venue]=22222222-2222-2222-2222-222222222222&page[size]=20&sort=-last_visit_on&page[number]=1",
    "first": "http://api.socialwifi.com/users/user-data/?filter[venue]=22222222-2222-2222-2222-222222222222&page[size]=20&sort=-last_visit_on&page[number]=1",
    "previous": null,
    "next": "http://api.socialwifi.com/users/user-data/?filter[venue]=22222222-2222-2222-2222-222222222222&page[size]=20&sort=-last_visit_on&page[number]=2",
    "last": "http://api.socialwifi.com/users/user-data/?filter[venue]=22222222-2222-2222-2222-222222222222&page[size]=20&sort=-last_visit_on&page[number]=26"
  },
  "meta": {
    "count": 20
  },
  "jsonapi": {
    "version": "1.0"
  }
}