Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2022-04-28 01:40 AM
Hello Team i am looking for a way i could unlink a record using REST API. Do you know which REST API function i would need to use to accomplish the same.
I have attached a screen shot. I would like to simulate removing those marked , using a rest API.
I tried using the DELETE. I think that does not simulate unlinking a record. Invoke-RestMethod -Method DELETE -Uri $api_url -Headers $headers -ContentType "application/json" -WebSession $sess
2022-04-28 03:17 AM
There is no unmap or map API verb or method. You just update record and provide all records to be mapped. Like overriding. CR is type = 9, check what @JeffLetterman provided:
2022-04-28 10:35 AM
To see correct API call and test it, I recommend the splendid tool @JeffLetterman crafted for all of us:
https://www.archerirm.community/t5/tkb/articleprintpage/tkb-id/exchange-overviews/article-id/256
2022-04-28 03:17 AM
There is no unmap or map API verb or method. You just update record and provide all records to be mapped. Like overriding. CR is type = 9, check what @JeffLetterman provided:
2022-04-28 03:35 AM
@Anonymous Thank you Very much. If i understand it correctly. I Have to use a Post Method to update the respective cross reference field with the desired ID's ?
2022-04-28 03:45 AM
Well POST or PUT, it is defined in the respective API guideline, but the approach is UPDATE.
2022-04-28 10:29 AM
I am trying to update the info but i am getting an error "The remote server returned an error: (400) Bad Request"
I get the same error with POST or PUT. Would you be able to tell me what i am doing incorrectly ?
Here is the code i am trying to use
$api_url = $base_url + "/api/core/content"
$body = '
"4973": {
"Type": 9,
"Value": [
{
"ContentId": 4454091
},
{
"ContentId": 4454097
},
{
"ContentId": 4454082
}
],
"FieldId": 4973
} '
$results = Invoke-RestMethod -Method POST -Uri $api_url -Body $body -Headers $headers -ContentType "application/json" -WebSession $sess
2022-04-28 10:35 AM
To see correct API call and test it, I recommend the splendid tool @JeffLetterman crafted for all of us:
https://www.archerirm.community/t5/tkb/articleprintpage/tkb-id/exchange-overviews/article-id/256