Skip to content

Quickstart

View as Markdown

You will create a key, look up the service to file against, open a request and read it back.

  1. Create an API key. In the Duty portal go to Integrations → Keys and webhooks and select Create key. Turn on Write access so the key can open requests. Copy the key: it starts with gm_sd_ and is shown only once.

    Keep it in an environment variable rather than in your code:

    Terminal window
    export DUTY_API_KEY="gm_sd_…"
  2. Find the service. Every request belongs to a service of your catalog. List them and note the id of the one to use:

    Terminal window
    curl https://api.client.service-desk.goldmaster.io/v1/services \
    -H "Authorization: Bearer $DUTY_API_KEY"
    {
    "data": [
    { "id": 12, "name": "VPN and remote access", "description": "Connection problems and access requests", "defaultPriority": "medium", "requiresApproval": false }
    ]
    }
  3. Open the request. Send the service, a subject, a description and who the request is for:

    Terminal window
    curl https://api.client.service-desk.goldmaster.io/v1/tickets \
    -H "Authorization: Bearer $DUTY_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "serviceId": 12,
    "subject": "VPN disconnects every few minutes",
    "description": "Since this morning the VPN drops every 5 to 10 minutes.",
    "contact": { "name": "Ana Pérez", "email": "ana.perez@example.com" }
    }'

    The API answers 201 Created with the full request. Its number (such as GM-000123) identifies it from now on, and responseDueAt and resolutionDueAt already carry the targets of your service level agreement.

  4. Read it back. Get the request with its current status and the transitions it can make next:

    Terminal window
    curl https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123 \
    -H "Authorization: Bearer $DUTY_API_KEY"
  • Keep your system in step with webhooks instead of polling.
  • Sync existing requests with updatedSince.
  • Learn the error format so your integration can explain what went wrong.