Job types
Get a job type’s default priority
/a/JobType_getPriority
Read the numeric priority that job editors use as this type’s default.
When to use this endpoint
Use JobType_getPriority only when a scalar priority is required. For a complete type record, use JobType_getRequestedDetails.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler performs no additional page or role-permission check.
The lookup and any write use the authenticated tenant; an ID from another tenant cannot be addressed through this call.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | Job-type ID. Input is integer-converted. |
Example request
$priority = FM_api('JobType_getPriority', [
'id' => '42',
]);
Example response
"4"
The response is a database scalar string, not an object. A SQL null value is returned as JSON null; a missing row or failed lookup returns JSON false.
Errors and unusual responses
| Response | Condition |
|---|---|
{"error":"not logged in"} | No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs. |
{"error":"missing or invalid parameter: id"} | The integer-converted ID is less than one. |
false | No row matches the ID or the scalar lookup fails. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- The numeric value is an index into the tenant’s configured priority labels; this endpoint does not return the label.
- The CRM job editors apply it when a type is selected. Existing jobs are not dynamically tied to later type-priority changes.
- There is no filtering or pagination.
See it in Fieldmotion
CRM1
A production-source search found no direct CRM1 caller; CRM1 receives priority through the type list/detail calls used by its settings and job screens.
CRM2
A production-source search found no direct CRM2 caller; CRM2 reads the mapped type record instead.
Related endpoints
JobType_setPriorityvalidates and stores the priority against the tenant choices.JobType_getRequestedDetailscan returnprioritywith other defaults.