How to use the ZPM REST API

This guide offers instructions on how to authenticate and use the ZPM Rest API.

The full API reference (all endpoints) is documented within your ZPM application at
https://{your-zpm}.app.goziro.com/app2/#/automate/

Access token request with a shared secret

ZIRO Uses Microsoft Identity Platform as an OAuth2 provider and offers a
Client Credentials Flow to generate a bearer token (JWT) for authentication.

Below is a sample curl request to generate a token

curl --location 'https://login.microsoftonline.com/goziro.com/oauth2/v2.0/token' \
--form 'client_id="00001111-aaaa-2222-bbbb-3333cccc4444"' \
--form 'client_secret="qWgdYAmab0YSkuL1qKv5bPX"' \
--form 'scope="api://contoso.app.goziro.com/.default"' \
--form 'grant_type="client_credentials"'
grant_type Must set to client_credentials
location Must be set to https://login.microsoftonline.com/goziro.com/oauth2/v2.0/token
scope api://{your-zpm-url}/.default
client_id Provided upon request
secret Provided upon request

Example 1 - Assign a Phone Number and Security Group to a User

The following example provisions UPN user carl@contoso.com by:

  • Assigning the next available number part of the New York 72 Dial Plan
  • Assigning them as a member of Group “Voice User” with UUID 13082852-64f4-486b-9549-3ecf0f777280

POST - https://zpm-demo.app.goziro.com/services/microsoft/automate-itsm/end-user-provisionings/v2

{
   "userPrincipalName":"carl@contoso.com",
   "teamsCalling":{
      "dialPlanGroupIds":[
         72
      ]
   },
  "memberOfGroups" : [ "13082852-64f4-486b-9549-3ecf0f777280"]
}

With 200 Response indicating the new phone number assigned to Carl:

{ 
"upn" : "carl@constoso.com",
"assignedNumber:": "+12125987555",
"assignedExtension": ""
}

Sample curl request

curl --location 'https://contoso.app.goziro.com/services/microsoft/automate-itsm/end-user-provisionings/v2' \
--header 'accept: */*' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJub25jZSI6ImFLM1JBLW1od0k3Y0UwQTJxQzJZbkdtS3drYXZPeTdoajBXSUv1hY4dlwXUAxQO9xmabmwlZ0K3CfWDJGtqS1CM1drczaFmDgCNhTLu7WQfyognN5zhTN5AyNVktlOmjV3BaYwA-VwDi01X5K8i2tx4G0T2hrzet2U4YL-nPBwqmqfBIava1vgFXhb9Pk8ILktynCX3_E40hF0Q-xQXf8Qye8xiRGYQbCNbSDYmNnTMbPJ0n4vXMlUiCg8FyCA' \
--data-raw '{
   "userPrincipalName":"carl@contoso.com",
   "teamsCalling":{
      "dialPlanGroupIds":[
         72
      ]
   },
  "memberOfGroups" : [ "13082852-64f4-486b-9549-3ecf0f777280"]
}
1 Like