This will create an account for your new hire in Zendesk

Manifest

{
    "form": [
        {
            "id": "ROLE_ID",
            "url": "https://{{SUBDOMAIN}}.zendesk.com/api/v2/custom_roles.json",
            "name": "Select the role to assign to the new hire in Zendesk",
            "type": "choice",
            "method": "GET",
            "data_from": "custom_roles"
        }
    ],
    "exists": {
        "url": "https://{{SUBDOMAIN}}.zendesk.com/api/v2/users/search.json?query={{email}}",
        "method": "GET",
        "expected": "{{first_name}} {{last_name}}"
    },
    "execute": [
        {
            "url": "https://{{SUBDOMAIN}}.zendesk.com/api/v2/users.json",
            "data": {
                "user": {
                    "name": "{{ first_name }} {{ last_name }}",
                    "role": "agent",
                    "email": "{{ email }}",
                    "custom_role_id": "{{ ROLE_ID }}"
                }
            },
            "method": "POST"
        }
    ],
    "headers": {
        "Accept": "application/json",
        "Content-Type": "application/json",
        "Authorization": "Basic {{ADMIN_EMAIL}}/token:{{TOKEN}}"
    },
    "initial_data_form": [
        {
            "id": "ADMIN_EMAIL",
            "name": "The admin email here with which the token was generated.",
            "description": "This is needed to authenticate the requests with."
        },
        {
            "id": "TOKEN",
            "name": "The token that was generated",
            "description": "Admin Center > Apps and integrations > APIs > Zendesk APIs"
        },
        {
            "id": "SUBDOMAIN",
            "name": "The subdomain that Zendesk gave to you. ",
            "description": "Without the 'zendesk.com' and the https protocol. Example: 'eggplant'"
        }
    ]
}

Instructions

  1. Create a new integration with this manifest.
  2. Go to Admin Center > Apps and integrations > APIs > Zendesk APIs and enable token access and create a new token.

Comments

No comments yet.