Device Registration Calls

Server Calls for User Validation for User Device Registration#

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. Register a New Device for User#

POST {{gmi_server_url}}/v2/gmiserver/app/{app_code}/device/{device_id}/register

curl --location --request POST '{{gmi_server_url}}/v2/gmiserver/app/{app_code}/device/{device_id}/register' \
--header 'Authorization: Bearer {{token}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"userId":"{{person_user_id}}"
"deviceName":"{{device_name}}",
"applicationVersion": "{{app_version}}",
"platform": "ios",
"platformVersion": "{{platform_version}}",
"clientVersion": "{{client_version}}"
}'

3. User Acquires Verification Code from Email#

4. Perform User Validation for User Device Registration#

POST {{gmi_server_url}}/v2/gmiserver/app/{app_code}/device/{device_id}/code/{verification_code}/validate

curl --location --request POST '{{gmi_server_url}}/v2/gmiserver/app/{app_code}/device/{device_id}/code/{verification_code}/validate' \
--header 'Authorization: Bearer {{token}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"userId":"{{person_user_id}}",
"pushToken":"{{push_token}}",
"publicKey":"{{public_key}}"
}'

5. GMI Now Trusts the User Device#

Server Calls for Tenant Validation for User Device Registration#

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. Register a New Device for User#

POST {{gmi_server_url}}/v2/gmiserver/app/{app_code}/device/{device_id}/register

curl --location --request POST '{{gmi_server_url}}/v2/gmiserver/app/{app_code}/device/{device_id}/register' \
--header 'Authorization: Bearer {{token}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"userId":"{{person_user_id}}"
"deviceName":"{{device_name}}",
"applicationVersion": "{{app_version}}",
"platform": "ios",
"platformVersion": "{{platform_version}}",
"clientVersion": "{{client_version}}"
}'

3. User Doesn't Have Access to Email, asks Tenant for Verification Code#

4. Tenant Gets List of Pending Registrations#

GET {{gmi_server_url}}/v2/gmiserver/tenant/{{tenant_code}}/person/registration

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

5. Tenant Gives Verification Code to User#

6. Perform User Validation for User Device Registration#

POST {{gmi_server_url}}/v2/gmiserver/app/{app_code}/device/{device_id}/code/{verification_code}/validate

curl --location --request POST '{{gmi_server_url}}/v2/gmiserver/app/{app_code}/device/{device_id}/code/{verification_code}/validate' \
--header 'Authorization: Bearer {{token}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"userId":"{{person_user_id}}",
"pushToken":"{{push_token}}",
"publicKey":"{{public_key}}"
}'

7. GMI Now Trusts the User Device#

Server Calls for Deleting a User Device#

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

3. Delete the Device for the User#

DELETE {{gmi_server_url}}/v2/gmiserver/tenant/{tenant_code}/person/{person_uuid}/app/{app_code}/device/{device_id}

curl --location --request DELETE '{{gmi_server_url}}/v2/gmiserver/tenant/{tenant_code}/person/{person_uuid}/app/{app_code}/device/{device_id}' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json' \
--header 'GMI-URL: {{gmi-url}}' \
--header 'GMI-SIGN: {{gmi-sign}}' \
--data-raw ''