User Calls

Server Calls for Searching for Users#

1. Get Auth Token#

POST {{user_server_url}}/v2/oauth2/oauth/token?scope=SCOPE_TENANT_ADMIN&grant_type=client_credentials

curl --location --request POST '{{user_server_url}}/v2/oauth2/oauth/token?scope=SCOPE_TENANT_ADMIN&grant_type=client_credentials' \
--header 'Authorization: Basic {{auth_credentials}}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-raw ''

2. Get a List of Users using a Filter#

GET {{gmi_server_url}}/v2/gmiserver/person?find={{find_string}}&sort={+,-}{{field}}&pageSize={int}&pageNo={{page_no}}&notEmpty={{field}}

curl --location --request GET '{{gmi_server_url}}/v2/gmiserver/person?find={{find_string}}&sort={+,-}{{field}}&pageSize={int}&pageNo={{page_no}}&notEmpty={{field}}' \
--header 'Authorization: Bearer {{token}}'

Server Calls for Getting a User#

1. Get Auth Token#

POST {{user_server_url}}/v2/oauth2/oauth/token?scope=SCOPE_TENANT_ADMIN&grant_type=client_credentials

curl --location --request POST '{{user_server_url}}/v2/oauth2/oauth/token?scope=SCOPE_TENANT_ADMIN&grant_type=client_credentials' \
--header 'Authorization: Basic {{auth_credentials}}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-raw ''

2. Get User Data by UUID#

GET {{gmi_server_url}}/v2/gmiserver/person/{{person_uuid}}

curl --location --request GET '{{gmi_server_url}}/v2/gmiserver/person/{{person_uuid}}' \
--header 'Authorization: Bearer {{token}}'

3. Get User Data by UserID#

GET {{gmi_server_url}}/v2/gmiserver/person?userId={{user_id}}

curl --location --request GET '{{gmi_server_url}}/v2/gmiserver/person?userId={{user_id}}' \
--header 'Authorization: Bearer {{token}}'

4. Get User Data by DeviceID#

GET {{gmi_server_url}}/v2/gmiserver/person?deviceId={{device_id}}

curl --location --request GET '{{gmi_server_url}}/v2/gmiserver/person?deviceId={{device_id}}' \
--header 'Authorization: Bearer {{token}}'

5. Get App User Data by UserID#

GET {{gmi_server_url}}/v2/gmiserver/app/{{app_code}}/person?userId={{user_id}}

curl --location --request GET '{{gmi_server_url}}/v2/gmiserver/app/{{app_code}}/person?userId={{user_id}}' \
--header 'Authorization: Bearer {{token}}'

6. Get App User Data by DeviceID#

GET {{gmi_server_url}}/v2/gmiserver/app/{{app_code}}/person?deviceId={{device_id}}

curl --location --request GET '{{gmi_server_url}}/v2/gmiserver/app/{{app_code}}/person?deviceId={{device_id}}' \
--header 'Authorization: Bearer {{token}}'

Server Calls for Creating a User#

1. Get Auth Token#

POST {{user_server_url}}/v2/oauth2/oauth/token?scope=SCOPE_TENANT_ADMIN&grant_type=client_credentials

curl --location --request POST '{{user_server_url}}/v2/oauth2/oauth/token?scope=SCOPE_TENANT_ADMIN&grant_type=client_credentials' \
--header 'Authorization: Basic {{auth_credentials}}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-raw ''

2. Get User Data by UserID#

GET {{gmi_server_url}}/v2/gmiserver/person?userId={{user_id}}

curl --location --request GET '{{gmi_server_url}}/v2/gmiserver/person?userId={{user_id}}' \
--header 'Authorization: Bearer {{token}}'

3a. Generate New Person Associated with a Tenant#

POST {{gmi_server_url}}/v2/gmiserver/tenant/{{tenant_code}}/person

curl --location --request POST '{{gmi_server_url}}/v2/gmiserver/tenant/{{tenant_code}}/person' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json' \
--data-raw '{"userId":"{{email}}"}'

3b. Associate an Existing Person with a Tenant#

PUT {{gmi_server_url}}/v2/gmiserver/tenant/{{tenant_code}}/person/{{person_uuid}}

curl --location --request PUT '{{gmi_server_url}}/v2/gmiserver/tenant/{{tenant_code}}/person/{{person_uuid}}' \
--header 'Authorization: Bearer {{token}}' \
--data-raw ''

Server Calls for Deleting a User#

1. Get Auth Token#

POST {{user_server_url}}/v2/oauth2/oauth/token?scope=SCOPE_TENANT_ADMIN&grant_type=client_credentials

curl --location --request POST '{{user_server_url}}/v2/oauth2/oauth/token?scope=SCOPE_TENANT_ADMIN&grant_type=client_credentials' \
--header 'Authorization: Basic {{auth_credentials}}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-raw ''

2. Get User Data by UserID#

GET {{gmi_server_url}}/v2/gmiserver/person?userId={{user_id}}

curl --location --request GET '{{gmi_server_url}}/v2/gmiserver/person?userId={{user_id}}' \
--header 'Authorization: Bearer {{token}}'
note

It'is important to only delete this user if they are no longer associated with any other tenant.#

3. Get List of Tenants for User#

GET {{gmi_server_url}}/v2/gmiserver/person/{{person_uuid}}/tenant

curl --location --request GET '{{gmi_server_url}}/v2/gmiserver/person/{{person_uuid}}/tenant' \
--header 'Authorization: Bearer {{token}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw ''

4. Delete the User#

DELETE {{gmi_server_url}}/v2/gmiserver/person/{{person_uuid}}

curl --location --request DELETE '{{gmi_server_url}}/v2/gmiserver/person/{{person_uuid}}' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json' \
--data-raw ''