Job Router Operations - Get Job

Retrieves an existing job by Id.

GET {endpoint}/routing/jobs/{jobId}?api-version=2023-11-01

URI Parameters

Name In Required Type Description
endpoint
path True

string

Uri of your Communication resource

jobId
path True

string

Id of a job.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Responses

Name Type Description
200 OK

RouterJob

The request has succeeded.

Headers

  • ETag: string
  • Last-Modified: string
Other Status Codes

Azure.Core.Foundations.ErrorResponse

An unexpected error response.

Headers

x-ms-error-code: string

Security

AadOauth2Auth

The Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: accessCode
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize
Token URL: https://login.microsoftonline.com/common/oauth2/token

Scopes

Name Description
https://communication.azure.com/.default

Examples

Retrieves an existing job by Id

Sample request

GET https://contoso.westus.communications.azure.com/routing/jobs/8780b28c-7079-4de1-9143-4d369289e958?api-version=2023-11-01

Sample response

{
  "id": "8780b28c-7079-4de1-9143-4d369289e958",
  "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af",
  "status": "queued",
  "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00",
  "channelId": "CustomVoiceChannel",
  "classificationPolicyId": null,
  "queueId": "MainQueue",
  "priority": 5,
  "dispositionCode": null,
  "requestedWorkerSelectors": [
    {
      "key": "Sales",
      "labelOperator": "equal",
      "value": true,
      "expiresAfterSeconds": null
    }
  ],
  "attachedWorkerSelectors": [],
  "labels": {},
  "assignments": {},
  "notes": [],
  "matchingMode": {
    "kind": "queueAndMatch"
  },
  "etag": "etag"
}

Definitions

Name Description
Azure.Core.Foundations.Error

The error object.

Azure.Core.Foundations.ErrorResponse

A response containing error details.

Azure.Core.Foundations.InnerError

An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.

JobMatchingModeKind

Discriminators for supported matching mode types.

LabelOperator

Describes supported operations on label values.

QueueAndMatchMode

Describes a matching mode where matching worker to a job is automatically started after job is queued successfully.

RouterJob

A unit of work to be routed

RouterJobAssignment

Assignment details of a job to a worker.

RouterJobNote

A note attached to a job.

RouterJobStatus

Describes the various status of a job.

RouterWorkerSelector

Describes a condition that must be met against a set of labels for worker selection.

RouterWorkerSelectorStatus

Describes the status of a worker selector.

ScheduleAndSuspendMode

Describes a matching mode used for scheduling jobs to be queued at a future time. At the specified time, matching worker to a job will not start automatically.

SuspendMode

Describes a matching mode where matching worker to a job is suspended.

Azure.Core.Foundations.Error

The error object.

Name Type Description
code

string

One of a server-defined set of error codes.

details

Azure.Core.Foundations.Error[]

An array of details about specific errors that led to this reported error.

innererror

Azure.Core.Foundations.InnerError

An object containing more specific information than the current object about the error.

message

string

A human-readable representation of the error.

target

string

The target of the error.

Azure.Core.Foundations.ErrorResponse

A response containing error details.

Name Type Description
error

Azure.Core.Foundations.Error

The error object.

Azure.Core.Foundations.InnerError

An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.

Name Type Description
code

string

One of a server-defined set of error codes.

innererror

Azure.Core.Foundations.InnerError

Inner error.

JobMatchingModeKind

Discriminators for supported matching mode types.

Value Description
queueAndMatch

Discriminator value for QueueAndMatchMode.

scheduleAndSuspend

Discriminator value for ScheduleAndSuspendMode.

suspend

Discriminator value for SuspendMode.

LabelOperator

Describes supported operations on label values.

Value Description
equal

Equal.

greaterThan

Greater than.

greaterThanOrEqual

Greater than or equal.

lessThan

Less than.

lessThanOrEqual

Less than or equal.

notEqual

Not Equal.

QueueAndMatchMode

Describes a matching mode where matching worker to a job is automatically started after job is queued successfully.

Name Type Description
kind string:

queueAndMatch

The type discriminator describing a sub-type of JobMatchingMode.

RouterJob

A unit of work to be routed

Name Type Description
assignments

<string,  RouterJobAssignment>

A collection of the assignments of the job. Key is AssignmentId.

attachedWorkerSelectors

RouterWorkerSelector[]

A collection of worker selectors attached by a classification policy, which a worker must satisfy in order to process this job.

channelId

string

The channel identifier. eg. voice, chat, etc.

channelReference

string

Reference to an external parent context, eg. call ID.

classificationPolicyId

string

Id of a classification policy used for classifying this job.

dispositionCode

string

Reason code for cancelled or closed jobs.

enqueuedAt

string (date-time)

Timestamp a job was queued in UTC.

etag

string

The entity tag for this resource.

id

string

Id of a job.

labels

A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean.

matchingMode JobMatchingMode:

If provided, will determine how job matching will be carried out. Default mode: QueueAndMatchMode.

notes

RouterJobNote[]

Notes attached to a job, sorted by timestamp.

priority

integer (int32)

Priority of this job. Value must be between -100 to 100.

queueId

string

Id of a queue that this job is queued to.

requestedWorkerSelectors

RouterWorkerSelector[]

A collection of manually specified worker selectors, which a worker must satisfy in order to process this job.

scheduledAt

string (date-time)

If set, job will be scheduled to be enqueued at a given time.

status

RouterJobStatus

The status of the job.

tags

A set of non-identifying attributes attached to this job. Values must be primitive values - number, string, boolean.

RouterJobAssignment

Assignment details of a job to a worker.

Name Type Description
assignedAt

string (date-time)

Timestamp when the job was assigned to a worker in UTC.

assignmentId

string

Id of a job assignment.

closedAt

string (date-time)

Timestamp when the job was marked as closed after being completed in UTC.

completedAt

string (date-time)

Timestamp when the job was marked as completed after being assigned in UTC.

workerId

string

Id of the Worker assigned to the job.

RouterJobNote

A note attached to a job.

Name Type Description
addedAt

string (date-time)

The time at which the note was added in UTC. If not provided, will default to the current time.

message

string

The message contained in the note.

RouterJobStatus

Describes the various status of a job.

Value Description
assigned

Job has been assigned to a worker.

cancelled

Job has been cancelled.

classificationFailed

Classification process failed for the job.

closed

Job has been closed by a worker.

completed

Job has been completed by a worker.

created

Job has been created.

pendingClassification

Job is waiting to be classified.

pendingSchedule

Job has been created but not been scheduled yet.

queued

Job has been queued.

scheduleFailed

Job scheduling failed.

scheduled

Job has been scheduled successfully.

waitingForActivation

Job is in a suspended state and waiting for an update.

RouterWorkerSelector

Describes a condition that must be met against a set of labels for worker selection.

Name Type Description
expedite

boolean

Pushes a job to the front of the queue as long as this selector is active.

expiresAfterSeconds

number (double)

Describes how long this label selector is valid in seconds.

expiresAt

string (date-time)

The time at which this worker selector expires in UTC.

key

string

The label key to query against.

labelOperator

LabelOperator

Describes how the value of the label is compared to the value defined on the worker selector.

status

RouterWorkerSelectorStatus

Status of the worker selector.

value

The value to compare against the actual label value with the given operator. Values must be primitive values - number, string, boolean.

RouterWorkerSelectorStatus

Describes the status of a worker selector.

Value Description
active

Worker selector is valid.

expired

Worker selector is not valid.

ScheduleAndSuspendMode

Describes a matching mode used for scheduling jobs to be queued at a future time. At the specified time, matching worker to a job will not start automatically.

Name Type Description
kind string:

scheduleAndSuspend

The type discriminator describing a sub-type of JobMatchingMode.

scheduleAt

string (date-time)

Requested schedule time.

SuspendMode

Describes a matching mode where matching worker to a job is suspended.

Name Type Description
kind string:

suspend

The type discriminator describing a sub-type of JobMatchingMode.