Example: Creating a ticket

Frequency of useCommon
Actors
  • An authenticated user (user)
Communication Flow: Kotlin
SupportDescriptions.createTicket.call(
    CreateTicketRequest(
        message = "Consequatur harum excepturi nemo consequatur laboriosam repellendus vel quos.", 
        subject = "My subject", 
    ),
    user
).orThrow()

/*
Unit
*/
Communication Flow: TypeScript
// Authenticated as user
await callAPI(SupportApi.createTicket(
    {
        "subject": "My subject",
        "message": "Consequatur harum excepturi nemo consequatur laboriosam repellendus vel quos."
    }
);

/*
{
}
*/
Communication Flow: Curl
# ------------------------------------------------------------------------------------------------------
# $host is the UCloud instance to contact. Example: 'http://localhost:8080' or 'https://cloud.sdu.dk'
# $accessToken is a valid access-token issued by UCloud
# ------------------------------------------------------------------------------------------------------

# Authenticated as user
curl -XPOST -H "Authorization: Bearer $accessToken" -H "Content-Type: content-type: application/json; charset=utf-8" "$host/api/support/ticket" -d '{
    "subject": "My subject",
    "message": "Consequatur harum excepturi nemo consequatur laboriosam repellendus vel quos."
}'


# {
# }
Communication Flow: Visual