Youniton Docs

Create help-desk requests from your app

Connect your client's own system — for example their service desk — to a project's help desk. It creates requests with files, reads their status and replies, with no person's account.

A help-desk token acts as one connection: one project, one client organisation and one read scope. Every call stays inside that connection.

#Before you start

  • An Admin creates the connection in Administration › Help desk: the client organisation, the project, the abilities (requests:create, requests:read, requests:reply, files:upload) and the read scope — own (the requests that this connection made) or organisation (every request of the client in the project).
  • The Admin issues the token. It starts with kanso_hdt_ and shows one time. Keep it in a secret store.
  • Help desk must be on for the project, and its request form must be on for a create.
Terminal
export API="https://app.youniton.example/api/v1/help-desk"
export AUTH="Authorization: Bearer $YOUNITON_HELPDESK_TOKEN"   # kanso_hdt_… — shown one time in Administration › Help desk

Send only the Authorization header: the token names the tenant, the connection and its project.

#The flow

  1. #Read the form

    The form of the connection's project gives the categories and the fields that a request needs.

    GET /help-desk/form
    curl -s -H "$AUTH" -H 'Accept: application/json' "$API/form"

    GET/help-desk/form — needs requests:read or requests:create.

  2. #Start an upload (optional)

    To attach a file, start an upload intent. The target is request_draft for a new request, or request with a requestKey for a reply.

    POST /help-desk/uploads
    curl -s -X POST -H "$AUTH" -H 'Content-Type: application/json' -H "Idempotency-Key: $(uuidgen)" "$API/uploads" \
      --data '{"target":{"type":"request_draft"},"fileName":"receipt.pdf","sizeBytes":182044,"mimeType":"application/pdf"}'
    # → 201 data.fileId, data.put.url, data.put.headers

    POST/help-desk/uploads — needs files:upload.

  3. #Send the file with one PUT

    Send the bytes to the presigned URL with one PUT. Send each header of data.put.headers with it. The URL is valid for 15 minutes. Do not send your Youniton token to this URL.

    PUT to the presigned URL
    curl -s -X PUT -H 'Content-Type: application/pdf' --data-binary @receipt.pdf '<data.put.url>'
  4. #Complete the upload

    POST /help-desk/uploads/{fileId}/complete
    curl -s -X POST -H "$AUTH" -H "Idempotency-Key: $(uuidgen)" "$API/uploads/<fileId>/complete"

    Youniton starts the malware scan. POST/help-desk/uploads/{fileId}/complete

  5. #Create the request

    Send the category, the texts, your own externalReference, the completed fileIds and the person at the client who reported it.

    POST /help-desk/requests
    curl -s -X POST -H "$AUTH" -H 'Content-Type: application/json' \
      -H "Idempotency-Key: $(uuidgen)" "$API/requests" --data '{
      "categoryKey": "website_bug",
      "summary": "Gift cards cannot be applied",
      "description": "A gift card code is refused at checkout.",
      "impact": "urgent",
      "externalReference": "orbit-desk:case:88412",
      "fileIds": ["<fileId>"],
      "reporter": {"name": "Sam Lee", "email": "[email protected]", "externalId": "orbit-desk-user-4471"}
    }'
    # → 201 {"data": {"key": "ORB-R22", "status": "in_review", …}}

    The same externalReference again gives the same request (200), never a second one. With another body it answers 409 help_desk_request.external_reference_exists with the existing requestKey. POST/help-desk/requests

  6. #Read it back, follow it and reply

    Reads and a reply
    curl -s -H "$AUTH" "$API/requests/ORB-R22"
    curl -s -H "$AUTH" "$API/requests?status=all"            # meta.changeCursor → ?changeCursor=… for the next page or poll
    curl -s -H "$AUTH" "$API/requests/ORB-R22/messages"
    curl -s -X POST -H "$AUTH" -H 'Content-Type: application/json' -H "Idempotency-Key: $(uuidgen)" \
      "$API/requests/ORB-R22/messages" --data '{"body":"It also fails on iPad."}'

    The list is a poll: read the change cursor. A file download answers 302 to a signed URL that is valid for 60 seconds.

  7. #Withdraw it (optional)

    POST /help-desk/requests/{requestKey}/withdraw
    curl -s -X POST -H "$AUTH" -H "Idempotency-Key: $(uuidgen)" "$API/requests/ORB-R22/withdraw"

    Only the connection that made the request can withdraw it, and only while it is open (403 access.forbidden with reason: not_requester). POST/help-desk/requests/{requestKey}/withdraw

#What each refusal means

AnswerMeaning
401 auth.unauthenticatedthe token is wrong, expired or revoked, or the connection is revoked
403 help_desk.ability_missingthe connection does not have the ability of the operation
403 help_desk.connection_pausedan Admin paused the connection
403 help_desk.unavailablehelp desk or its form is off for the project
404 help_desk_request.not_foundthe request is not of the connection's project and client, or not in its read scope
409 help_desk_request.external_reference_existsthe external reference names a request with another body
429 rate_limit.exceededtoo many calls, creates or uploads; wait for Retry-After

#What the team sees

Each request shows in the project's Help desk queue as API connection · <connection name>. When the reporter's e-mail is the e-mail of a portal guest of the same client, the request shows in that guest's portal list as theirs. Youniton never e-mails a reporter: your system learns of changes by polling or by webhooks.

#Get changes by webhook

A connection can subscribe its client's system to request events: request.created, request.updated, request.message_posted, request.decided and request.closed. A connection never gets an event for its own action. The payload holds the request as the connection may read it, without the description and the field values: read them with GET/help-desk/requests/{requestKey}. Read Receive Youniton webhooks.

Was this helpful?