- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
When creating/updating records via REST API, what is the JSON format for each field type?
When creating/updating records using REST API, I struggled to figure out what the JSON format was for each field type (Record Permissions, Cross-Reference, IP Address, etc). Does anyone have examples for these field types or others? Any other tip/tricks would be helpful too. Thanks!
- Tags:
- API
- Archer
- archertoolbox
- Community Thread
- Discussion
- Forum Thread
- json
- REST API
- RSA Archer
- RSA Archer Suite
- Tips
- Tips and Tricks
- tool time
- Tricks
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Below are some examples for most input field types.
In most examples, you will notice a JSON property called "Tag". It can be used with most field types and I use it to show the Field Name, Field Type, and/or a comment about the field. This helps me troubleshoot and know what that field is. NOTE: the "Tag" property is not required or a part of the Archer REST API, but it can be taken advantage of since extra properties are ignored.
Text - single line (Type = 1)
"13867": {
"Type": 1,
"Tag": "Name (Text)",
"Value": "Record created via REST API",
"FieldId": 13867
}
Text Area - HTML (Type = 1)
"13868": {
"Type": 1,
"Tag": "Description (Text)",
"Value": "<p>This is a Text Area field containing HTML content with different <strong><span style=\"color: #ff0000;\">colors</span> </strong> and <span style=\"font-family: comic sans ms,sans-serif;\"><em><span style=\"font-size: 14pt;\">font </span></em></span><span style=\"font-size: 18pt;\">sizes</span>. <span style=\"background-color: #ffff00;\">This is highlighted yellow.</span></p>\r\n<p>My bullet points</p>\r\n<ul>\r\n<li>Point 1</li>\r\n<li>Point 2</li>\r\n</ul>\r\n<p>Image via link</p><img src=\"https://community.rsa.com/resources/images/palette-1013/RSA-Logo-55px.png\" />",
"FieldId": 13868
}
Numeric (Type = 2)
"13890": {
"Type": 2,
"Tag": "My Number (Numeric)",
"Value": 123.456,
"FieldId": 13890
}
Date Only (Type = 3)
"13888": {
"Type": 3,
"Tag": "My Date (Date)",
"Value": "2016-12-14",
"FieldId": 13888
}
Date and Time (Type = 3)
"13999": {
"Type": 3,
"Tag": "My Date Time (Date)",
"Value": "2014-03-06T21:30:00",
"FieldId": 13999
}
Values List (Type = 4)
"13870": {
"Type": 4,
"Tag": "Severity (Values List)",
"Value": {
"ValuesListIds": [
63738,
63821
],
"OtherText": "whatever"
},
"FieldId": 13870
}
External Links (Type = 7)
"14009": {
"Type": 7,
"Tag": "My URLs (External Links)",
"Value": [
{
"Name": "RSA",
"Url": "https://www.rsa.com"
},
{
"Name": "Archer Community",
"Url": "https://community.rsa.com/community/products/archer-grc"
},
{
"Name": "Search Archer KBs",
"Url": "https://community.rsa.com/community/products/archer-grc/knowledge-base"
},
{
"Name": "Archer Community discussion about PowerShell and API",
"Url": "https://community.rsa.com/message/866965"
},
{
"Name": "KB 32481 - How to use the RSA Archer REST API with Windows PowerShell",
"Url": "https://community.rsa.com/docs/DOC-45643"
}
],
"FieldId": 14009
}
Record Permissions (Type = 😎
"13877": {
"Type": 8,
"Tag": "My Manager (Record Permissions)",
"Value": {
"UserList": [
{
"Id": 190
},
{
"Id": 2
}
],
"GroupList": [
{
"Id": 19
}
]
},
"FieldId": 13877
}
User/Groups List (Type = 😎
"14538": {
"Type": 8,
"Tag": "My Users and Groups List (User/Groups List) and Max=1 and select from a limited list",
"Value": {
"UserList": null,
"GroupList": [
{
"Id": 44
}
]
},
"FieldId": 14538
}
Cross-Reference (Type = 9)
"13907": {
"Type": 9,
"Tag": "My Contacts (Cross-Reference to Contacts)",
"Value": [
{
"ContentId": 205522
},
{
"ContentId": 318794
},
{
"ContentId": 325672
}
],
"FieldId": 13907
}
Attachment (Type = 11)
"13881": {
"Type": 11,
"Tag": "Attachments (Attachment)",
"Value": [
2068
],
"FieldId": 13881
}
Image (Type = 12)
"13872": {
"Type": 12,
"Tag": "Screenshot (Image)",
"Value": [
2069
],
"FieldId": 13872
}
Matrix (Type = 16)
"14088": {
"Type": 16,
"Tag": "My Matrix (Matrix)",
"Value": [
{
"RowId": 63880,
"ColumnId": 63879
}
],
"FieldId": 14088
}
IP Address (Type = 19)
"14410": {
"Type": 19,
"IpAddressBytes": "127.0.0.1",
"FieldId": 14410
}
Related Records (Type = 23)
"14573": {
"Type": 23,
"Tag": "Test (Related Records to App)",
"Value": [
339014,
338736
],
"FieldId": 14573
}
Sub-Forms (Type = 24)
"13886": {
"Type": 24,
"Tag": "My Sub Forms (Sub-Form)",
"Value": [
339019
],
"FieldId": 13886
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Below are some examples for most input field types.
In most examples, you will notice a JSON property called "Tag". It can be used with most field types and I use it to show the Field Name, Field Type, and/or a comment about the field. This helps me troubleshoot and know what that field is. NOTE: the "Tag" property is not required or a part of the Archer REST API, but it can be taken advantage of since extra properties are ignored.
Text - single line (Type = 1)
"13867": {
"Type": 1,
"Tag": "Name (Text)",
"Value": "Record created via REST API",
"FieldId": 13867
}
Text Area - HTML (Type = 1)
"13868": {
"Type": 1,
"Tag": "Description (Text)",
"Value": "<p>This is a Text Area field containing HTML content with different <strong><span style=\"color: #ff0000;\">colors</span> </strong> and <span style=\"font-family: comic sans ms,sans-serif;\"><em><span style=\"font-size: 14pt;\">font </span></em></span><span style=\"font-size: 18pt;\">sizes</span>. <span style=\"background-color: #ffff00;\">This is highlighted yellow.</span></p>\r\n<p>My bullet points</p>\r\n<ul>\r\n<li>Point 1</li>\r\n<li>Point 2</li>\r\n</ul>\r\n<p>Image via link</p><img src=\"https://community.rsa.com/resources/images/palette-1013/RSA-Logo-55px.png\" />",
"FieldId": 13868
}
Numeric (Type = 2)
"13890": {
"Type": 2,
"Tag": "My Number (Numeric)",
"Value": 123.456,
"FieldId": 13890
}
Date Only (Type = 3)
"13888": {
"Type": 3,
"Tag": "My Date (Date)",
"Value": "2016-12-14",
"FieldId": 13888
}
Date and Time (Type = 3)
"13999": {
"Type": 3,
"Tag": "My Date Time (Date)",
"Value": "2014-03-06T21:30:00",
"FieldId": 13999
}
Values List (Type = 4)
"13870": {
"Type": 4,
"Tag": "Severity (Values List)",
"Value": {
"ValuesListIds": [
63738,
63821
],
"OtherText": "whatever"
},
"FieldId": 13870
}
External Links (Type = 7)
"14009": {
"Type": 7,
"Tag": "My URLs (External Links)",
"Value": [
{
"Name": "RSA",
"Url": "https://www.rsa.com"
},
{
"Name": "Archer Community",
"Url": "https://community.rsa.com/community/products/archer-grc"
},
{
"Name": "Search Archer KBs",
"Url": "https://community.rsa.com/community/products/archer-grc/knowledge-base"
},
{
"Name": "Archer Community discussion about PowerShell and API",
"Url": "https://community.rsa.com/message/866965"
},
{
"Name": "KB 32481 - How to use the RSA Archer REST API with Windows PowerShell",
"Url": "https://community.rsa.com/docs/DOC-45643"
}
],
"FieldId": 14009
}
Record Permissions (Type = 😎
"13877": {
"Type": 8,
"Tag": "My Manager (Record Permissions)",
"Value": {
"UserList": [
{
"Id": 190
},
{
"Id": 2
}
],
"GroupList": [
{
"Id": 19
}
]
},
"FieldId": 13877
}
User/Groups List (Type = 😎
"14538": {
"Type": 8,
"Tag": "My Users and Groups List (User/Groups List) and Max=1 and select from a limited list",
"Value": {
"UserList": null,
"GroupList": [
{
"Id": 44
}
]
},
"FieldId": 14538
}
Cross-Reference (Type = 9)
"13907": {
"Type": 9,
"Tag": "My Contacts (Cross-Reference to Contacts)",
"Value": [
{
"ContentId": 205522
},
{
"ContentId": 318794
},
{
"ContentId": 325672
}
],
"FieldId": 13907
}
Attachment (Type = 11)
"13881": {
"Type": 11,
"Tag": "Attachments (Attachment)",
"Value": [
2068
],
"FieldId": 13881
}
Image (Type = 12)
"13872": {
"Type": 12,
"Tag": "Screenshot (Image)",
"Value": [
2069
],
"FieldId": 13872
}
Matrix (Type = 16)
"14088": {
"Type": 16,
"Tag": "My Matrix (Matrix)",
"Value": [
{
"RowId": 63880,
"ColumnId": 63879
}
],
"FieldId": 14088
}
IP Address (Type = 19)
"14410": {
"Type": 19,
"IpAddressBytes": "127.0.0.1",
"FieldId": 14410
}
Related Records (Type = 23)
"14573": {
"Type": 23,
"Tag": "Test (Related Records to App)",
"Value": [
339014,
338736
],
"FieldId": 14573
}
Sub-Forms (Type = 24)
"13886": {
"Type": 24,
"Tag": "My Sub Forms (Sub-Form)",
"Value": [
339019
],
"FieldId": 13886
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Thank you for that, Jeff. Very useful!
And I'm glad to see that you also have twice the same Type = 8, for both Record Permissions and User/Groups List. Despite the documentation I finally found claimed Record Permissions would be of Type = 15:
But indeed, both Record Permissions and User/Group List fields are returned with the same Type = 8 by the RESTful API. The only way I found to differentiate them is the dedicated property IsRecordPermission of type Boolean.
If it's a User/Group List field, you get something like:
{
"IsRecordPermission": false,
"Type": 8,
"Id": 20106,
"Name": "Source Author"
}
}
And if it's a Record Permission, you get this:
{
"IsRecordPermission": true,
"Type": 8,
"Id": 5733,
"Name": "Manager"
}
Am I correct? Does the RESTful API indeed never return the Type = 15 for Record Permission fields?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
kwNZ5L8U28cF4ljSK6pqrnFiERYsRpp4T8O7iHG2HWE= - Yes, that is correct. Record Permission and User/Groups List both use Type = 8. Thanks for the IsRecordPermission tip too...never noticed that before.
The documentation defect was logged as ARCHER-24783 and will be corrected in the next release of the REST API Guide.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
You can use Archer API Template with the REST Control : api/core/content/*contentid* which gives all field of a record in JSON
Example:
{
"Links": [],
"RequestedObject": {
"Id": 270135,
"LevelId": 146,
"SequentialId": 531,
"FieldContents": {
"38539": {
"Type": 11,
"Value": [
6536,
6537,
6618
],
"FieldId": 38539,
"UpdateInformation": {
"CreateDate": null,
"UpdateDate": null,
"CreateLogin": null,
"UpdateLogin": null
}
},
"38542": {
"Type": 6,
"FieldId": 38542,
"UpdateInformation": {
"CreateDate": null,
"UpdateDate": null,
"CreateLogin": null,
"UpdateLogin": null
}
},
"39061": {
"Type": 21,
"FieldId": 39061,
"UpdateInformation": {
"CreateDate": null,
"UpdateDate": null,
"CreateLogin": null,
"UpdateLogin": null
}
},
"39308": {
"Type": 22,
"FieldId": 39308,
"UpdateInformation": {
"CreateDate": null,
"UpdateDate": null,
"CreateLogin": null,
"UpdateLogin": null
}
},
"39379": {
"Type": 23,
"Value": [
271609
],
"FieldId": 39379,
"UpdateInformation": {
"CreateDate": null,
"UpdateDate": null,
"CreateLogin": null,
"UpdateLogin": null
}
},
"38536": {
"Type": 1,
"IsError": false,
"Value": "Alert with Entity and Linked Address",
"FieldId": 38536,
"UpdateInformation": {
"CreateDate": null,
"UpdateDate": null,
"CreateLogin": null,
"UpdateLogin": null
}
},
"39270": {
"Type": 4,
"IsError": false,
"Value": {
"ValuesListIds": [
87864
],
"OtherText": null
},
"FieldId": 39270,
"UpdateInformation": {
"CreateDate": null,
"UpdateDate": null,
"CreateLogin": null,
"UpdateLogin": null
}
},
"FieldId": 39302,
"UpdateInformation": {
"CreateDate": null,
"UpdateDate": null,
"CreateLogin": null,
"UpdateLogin": null
}
},
"CheckSum": null,
"LastUpdated": "2017-05-19T13:19:48.14",
"Version": 41,
"UpdateInformation": {
"CreateDate": "2016-11-17T18:16:05.48",
"UpdateDate": "2017-05-19T13:18:24.773",
"CreateLogin": 350,
"UpdateLogin": 189
}
},
"IsSuccessful": true,
"ValidationMessages": []
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
daGjf7HOzC0MQsqPGAPHl8ovFPk75obP5TkqWBBVboY=
Hi Jeff,
Is there a way we can update ValuesList field by just passing the "value" rather than specifying the "value id" also?
Asking as there are huge number of fields to be updated and mapping becomes tiring.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Arun the APIs will only except IDs.
The reason IDs are used is that the text of the value could change at any time thus breaking the code while ID's will remain constant; unless it's across environments.
Advisory Consultant - Archer, an RSA Business
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Is there a way we can get all the values from the valueslist field using API then so that i can map the value ids programmatically.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Via Archer API Template run the REST Controller : api/core/system/valueslistvalue/valueslist/*valueslistid*
Or create a record with all values selected in the Values List field and get content of the record. The Ids to each option selected will be shown
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
If i pass with api/core/system/valueslistvalue/valueslist/*valueslistid* i am not getting any values. Please find the below screenshot.
