Skills
Retrieve skills by ID
/a/Skills_getById
Fetch selected raw skill columns for a known batch of IDs, primarily to resolve exported job constraints.
When to use this endpoint
Use Skills_getById when another dataset contains skill IDs and you need a compact lookup. For CRM2 mapped names and filters, use Skill_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 |
|---|---|---|---|
ids | JSON array or native array | Yes | Skill IDs. Members are integer-converted and deduplicated; 0 is retained. Scalar decoded values are not promoted to an array. |
fields | JSON array or native array | No | Any of id, name, description, cdate, and last_edited. Omission selects all; unknown and duplicate names are discarded. |
Example request
$skills = FM_api('Skills_getById', [
'ids' => json_encode(['42', '43']),
'fields' => json_encode(['id', 'name']),
]);
Example response
[
{"id": "42", "name": "Electrical testing"},
{"id": "43", "name": "Gas safety"}
]
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: ids"} | The ids key is absent. |
{"error":"no ids in list"} | The decoded/native ID array is empty. |
{"error":"no fields selected"} | A present field list contains no allowed name. |
Runtime warning or type error | An ID/field value is malformed JSON or decodes to a non-array. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Missing IDs are silently omitted. The query defines no ordering, paging, or maximum.
- All raw database values remain strings, including Unix timestamp columns. Skills have no archived/deleted filter.
See it in Fieldmotion
CRM1
Export data containing the Skills value for jobs. CRM1’s export widget collects unique IDs and requests id/name through this route.
CRM2
CRM2’s export widgets perform the same ID/name resolution for exported job skill constraints.
Related endpoints
Skills_listreturns every ID/name pair without an ID input.Skill_getRequestedDetailssupports exact filters and mapped ordering.