In this article, you can read about how to retrieve a history of ended jobs and how to formally end an active job via the API using the endedJob and endJob scopes.
Retrieving Ended Jobs
GET
https://api.recman.io/v2/get/?key={{api_key}}&scope=endedJob&page=1&serviceTypeId=424Retrieving the history of ended jobs is done through the GET method, using https://api.recman.io/v2/get/ with scope=endedJob.
PARAMS
| Field | Required | Description |
|---|---|---|
| key | yes | Your API key |
| scope | yes | Must be endedJob |
| page | yes | Page number; 1,000 records per page |
| minEndedJobId | no | Minimum ended-job ID to filter by |
| minJobId | no | Minimum job ID to filter by |
| serviceTypeId | no | Filter by a specific service type |
Note
You can combine different search parameters to adjust your fetch requests more precisely.
Response fields
| Field | Description |
|---|---|
| endedId | ID of the "ended job" record |
| jobId | ID of the job that was ended |
| ended | Timestamp of when the job was ended |
| endedUserId | ID of the user who ended the job |
| comments | Comments left when ending the job |
| reasonId | Reason code for ending the job (see reason table below) |
| job | Nested object containing the full set of job fields for the ended job |
Ending a Job
To formally end an active job, use the POST method with https://api.recman.io/v2/post/, operation set to insert and scope set to endJob.
| Field | Type | Required | Description |
|---|---|---|---|
| jobId | integer | yes | ID of the job to end |
| reasonId | integer | yes | Reason for ending the job (see table below) |
| endedUserId | integer | yes | ID of the user ending the job |
| comments | string | no | Comment for ending the job (note: field name is spelled this way in the API) |
| rating | integer | no | Rating from 1–5. 0 or blank gives Undefined. |
| serviceTypeId | integer | no | Service type ID connected to the job |
Reason ID values
| reasonId | Reason |
|---|---|
| 1 | Job finished |
| 2 | Trial period ended |
| 3 | Buyout |
| 4 | Fired |
| 5 | Fired by customer |
| 6 | Other |
| 7 | Canceled by employee |
| 8 | Canceled by customer |
Note
On success, the response returns "success": true with no additional data.
What's next?
Return to Jobs: Retrieving, Creating, Updating, and Deleting Job Records via the API.