Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

How to chage the response of REST API method or How to merge to methods

RakeshSharma2
Contributor

Hello

Good Morning, Can you help in merging two below given  different REST API methods:-

1. In the below response not able to see the value names, but only can see value IDs. Business requirement is have both name and ID in response. In step-2 we can see both name and ID but as per requirement need to filter values by calling the

method in step-1. How can we do merging of methods in step-1 and step-2? Or is there any other way forward to achieve this requirement?


https://RSAArcher/api/core/system/eventaction/eventrule/1098 (*RuleID*)

 

Response:-

 

[
{
"Links": [],
"RequestedObject": {
"FieldId": 11703,
"AvailableValuesListValueIds": [
14727,
14728,
14729,
14730,
14731
],
"Type": 1,
"Id": 1216,
"Name": "Political Sub-Categories Filter",
"Alias": "Political_SubCategories_Filter",
"GUID": "8d0c4064-d9fc-4a9a-b669-7e7391feec9f",
"LayoutId": 194,
"Description": null,
"IsActive": true,
"UpdateInformation": {
"CreateDate": "2019-09-07T08:57:38.193",
"UpdateDate": "2019-10-16T09:08:25.29",
"CreateLogin": 27827,
"UpdateLogin": 27827
}
},
"IsSuccessful": true,
"ValidationMessages": []
}
]

 

Step- 2. In the below method's response I can see both value name and ID. However as per business requirement need to apply the DDE rule/action to filter the values as shown in Step-1.

 

URL
https://RSAArcher/api/core/system/valueslistvalue/valueslist/*RelatedValuesListID*

Response 2

{
"Links": [],
"RequestedObject": {
"Children": [
{
"Data": {
"Id": 14709,
"GUID": "2d4ff04b-8fb1-40c2-a52d-50eb8f2f1dd3",
"ValuesListId": 1557,
"Name": "Threat",
"Description": null,
"IsDefault": false,
"SortOrder": 0,
"NumericValue": null,
"IsActive": true,
"IsCorrect": false,
"ASOStatus": 0,
"EnableOtherText": false,
"DefaultOtherText": "Other...",
"ParentId": null,
"Alias": "Threat",
"IsSelectable": false,
"UpdateInformation": {
"CreateDate": null,
"UpdateDate": null,
"CreateLogin": null,
"UpdateLogin": null
}
},
"Children": [],
"Depth": 0
},
{
"Data": {
"Id": 14710,
"GUID": "ec400098-4e96-4bfb-9ac0-9ac0721a0739",
"ValuesListId": 1557,
"Name": "Opportunity",
"Description": null,
"IsDefault": false,
"SortOrder": 1,
"NumericValue": null,
"IsActive": true,
"IsCorrect": false,
"ASOStatus": 0,
"EnableOtherText": false,
"DefaultOtherText": "Other...",
"ParentId": null,
"Alias": "Opportunity",
"IsSelectable": false,
"UpdateInformation": {
"CreateDate": null,
"UpdateDate": null,
"CreateLogin": null,
"UpdateLogin": null
}
},
"Children": [],
"Depth": 0
}
]
},
"IsSuccessful": true,
"ValidationMessages": []
}

3 REPLIES 3

DavidFreeman
Archer Employee
Archer Employee

Hi Rakesh,

 

It's multiple steps:

 

You have the fieldid to get the field definition.

Then you'll need the values list id within those results.

Using the values list id, you can get the values associated.

Then you can get the ID of the value you're after.

 

David

 

Thanks David,

I git it and applied.

 

Rakesh

Hello

Good Morning, Can you help in merging two below given  different REST API methods:-

1. In the below response not able to see the value names, but only can see value IDs. Business requirement is have both name and ID in response. In step-2 we can see both name and ID but as per requirement need to filter values by calling the

method in step-1. How can we do merging of methods in step-1 and step-2? Or is there any other way forward to achieve this requirement?


https://RSAArcher/api/core/system/eventaction/eventrule/1098 (*RuleID*)

 

Response:-

 

[
{
"Links": [],
"RequestedObject": {
"FieldId": 11703,
"AvailableValuesListValueIds": [
14727,
14728,
14729,
14730,
14731
],
"Type": 1,
"Id": 1216,
"Name": "Political Sub-Categories Filter",
"Alias": "Political_SubCategories_Filter",
"GUID": "8d0c4064-d9fc-4a9a-b669-7e7391feec9f",
"LayoutId": 194,
"Description": null,
"IsActive": true,
"UpdateInformation": {
"CreateDate": "2019-09-07T08:57:38.193",
"UpdateDate": "2019-10-16T09:08:25.29",
"CreateLogin": 27827,
"UpdateLogin": 27827
}
},
"IsSuccessful": true,
"ValidationMessages": []
}
]

 

Step- 2. In the below method's response I can see both value name and ID. However as per business requirement need to apply the DDE rule/action to filter the values as shown in Step-1.

 

URL
https://RSAArcher/api/core/system/valueslistvalue/valueslist/*RelatedValuesListID*

Response 2

{
"Links": [],
"RequestedObject": {
"Children": [
{
"Data": {
"Id": 14709,
"GUID": "2d4ff04b-8fb1-40c2-a52d-50eb8f2f1dd3",
"ValuesListId": 1557,
"Name": "Threat",
"Description": null,
"IsDefault": false,
"SortOrder": 0,
"NumericValue": null,
"IsActive": true,
"IsCorrect": false,
"ASOStatus": 0,
"EnableOtherText": false,
"DefaultOtherText": "Other...",
"ParentId": null,
"Alias": "Threat",
"IsSelectable": false,
"UpdateInformation": {
"CreateDate": null,
"UpdateDate": null,
"CreateLogin": null,
"UpdateLogin": null
}
},
"Children": [],
"Depth": 0
},
{
"Data": {
"Id": 14710,
"GUID": "ec400098-4e96-4bfb-9ac0-9ac0721a0739",
"ValuesListId": 1557,
"Name": "Opportunity",
"Description": null,
"IsDefault": false,
"SortOrder": 1,
"NumericValue": null,
"IsActive": true,
"IsCorrect": false,
"ASOStatus": 0,
"EnableOtherText": false,
"DefaultOtherText": "Other...",
"ParentId": null,
"Alias": "Opportunity",
"IsSelectable": false,
"UpdateInformation": {
"CreateDate": null,
"UpdateDate": null,
"CreateLogin": null,
"UpdateLogin": null
}
},
"Children": [],
"Depth": 0
}
]
},
"IsSuccessful": true,
"ValidationMessages": []
}#@