User accounts and profiles
Read a linked company’s name
/a/User_getCompanyName
Resolve the current company name or an outsourcing-linked company’s display name.
When to use this endpoint
Use to label the company that sent an outsourced job. Despite the User prefix, id identifies a company/account, not an employee.
Authentication and permissions
Authenticate with signed API-key fields or a logged-in CRM session. Session requests use the dispatcher’s CSRF protection when configured; signed requests follow the API-key authentication flow.
The handler requires an authenticated tenant and adds no administrator, Users page or self-only permission check. This describes this legacy route; permissions enforced by other User update routes do not automatically apply here.
This is an account/company utility and is exempt from User-record ID scope interpretation. Authentication and its own current-account/outsourcing-link authorization still apply; unlinked company names remain unavailable.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | No | Omitted or equal to the current account ID reads the current company. Other values are integer-converted and checked for a global outsourcing link in either direction; blank/zero does not default to the current account. |
Example request
$result = FM_api('User_getCompanyName', [
'id'=>'2048',
]);
Example response
"Example services"
Returns a JSON string, false for a missing matched account row, or null for a SQL-null company value; not an object. UNKNOWN is an ordinary JSON string response.
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. |
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 current-company branch reads global account settings. The external-company branch requires any matching bidirectional outsourcing link; no link status, approval, active or deletion condition is added.
- No matching link returns the literal string UNKNOWN. If a matching link exists but the account row/company value is absent, a missing account row returns false and a SQL-null company value returns null, rather than UNKNOWN.
- No collection filtering, pagination, ordering or batch result is provided. Parameters on this page describe the supported scalar/encoded input; malformed nested values are not a supported contract.
- The dispatcher does not treat company IDs as user IDs. Existing outsourcing links in either direction remain sufficient for a label, including retained/pending links; this does not grant any record or Job access.
Side effects
- Read-only global account and link lookup; no tenant record changes, cache writes or activity log.
See it in Fieldmotion
CRM1
Open an outsourced Job in CRM1. The created-by label calls User_getCompanyName with meta.outsourcing.link_from and displays the returned string.
CRM2
No direct production caller was found in CRM2. Its User layouts use the generic getRequestedDetails/updateData flow instead; do not assume that flow has the same validation or permissions as this legacy route.
Related endpoints
User_getVehicle— Resolve the assigned user’s vehicle reference.User_getMeta— Read one tenant metadata value.