Custom fields using the API
Following the introduction of our Custom fields, we have included the ability to display, get & set the fields using our API. This has been added to all tiers on V4 and is located in the Company Controller (Excluding Calmony tier).
Get Custom Field by ObjectID -
- The first step would be to create your own custom fields on AgentOS itself. For this example we have chosen to add it to a property, so we can see the type of pets the landlord accepts.
Please access the following guides to add custom fields & tabs.
- The custom field end point has been added to all Company Controllers on V4. You can access our Swagger Documentation Here.
- The request URL would be /v4/advertising/{shortName}/company/object/{objectID}/customfield
- You would need to enter your shortName, and the Object ID. The object ID can be the OID of any object with a custom field (property, tenancy, landlord etc). For our example, we are entering the OID of the property.
- The response will return the following -
{
"CustomFields": [
{
"ID": "string",
"TabName": "string",
"GroupName": "string",
"FieldName": "string",
"Value": {}
}
]
}
Get & Set Custom Field Value
You can now Get & Set Custom Fields using the API and any changes you make will appear in AgentOS. This has been added to the Company Controller on every V4 Tier (excluding Calmony).
Get Custom Field Value
This will retrieve the value of a specific custom field.
To get the Custom Field value, you will need the following parameters-
- shortName
- Object OID
- Field ID – This can be retrieved from the Get Custom Field by ObjectID end point.
The value of the custom field will be returned only.
Set Custom Field Value
This will set the Custom Field value using the API.
To set the custom field value, you will need to send the following parameters-
- shortName
- Object OID
- Field ID – This can be retrieved from the Get Custom Field by ObjectID end point.
- Value – the value to set for the custom field.
If the call has been successful, you will receive “Field Set –‘Value’”
If the call has been unsuccessful you will receive “Unable to set Field Value”
All successful changes will appear on AgentOS.
Here is a list of the common custom field types and the format to set the values -
Field | Format |
Date | DD-MM-YYYY |
Slider | true or false |
Text | String |
Number | INT |
Please contact api@agentos.com if you require any assistance.
Comments
0 comments
Article is closed for comments.