Looking for updating Context Values using API just like an Action - Set Context Value.
Hello, so unfortunately this is not a documented API call. Reference the Swagger doc that is available on all instances for the official API. Saying that, you can use developer tools on your browser to determine what API endpoint is being called and more importantly what the payload is. I did this with a manual action that adds a new context value.Basically I opened dev tools when making the manual action.
@ipninichuck Thanks for this insight. Could you please help me better understand the payload structure? I’m seeing a lot of information, and I'm a bit confused about how to format the POST method correctly. Any guidance would be greatly appreciated.
Set Context value - this should overwrite/update the existing value. Is that what you're after?
@SoarAndy Yes, but by using API. So I can use HTML Widget to modify ContextValues on the fly.
Hello skadav,
Thanks for the follow-up on your question. I'm ooo but I'll get back to this for you once I'm back. If Andy beats me to it all the better, otherwise I'll sort the answer for you.
@ipninichuck @SoarAndy can you please help me.
Below details I am able to capture:
Request URL: https://XXXXXXXXX.siemplify-soar.com/api/external/v1/cases/ExecuteManualAction?format=camel
Payload:
{alertGroupIdentifiers: [,…], scope: "All entities", targetEntities: [], caseId: 9923,…}
actionName: "Tools_Set Context Value"
actionProvider: "Scripts"
alertGroupIdentifiers: [,…]
0: "RULE_RULE_NAME_DETECTION_MONITORINGQGp5E7Z5ngvXevbIMImaIjrXXXXZMagXXXy5CJ9CCFE=_1c2ad9df-e8b1-4df8-a956-d4640a6896d9"
caseId: 9923
isPredefinedScope: true
properties: {ScriptName: "Tools_Set Context Value",…}
IntegrationInstance: "52d7b3da-xxxx-xxxx-xxxx-a36827c3XXXX"
ScriptName: "Tools_Set Context Value"
ScriptParametersEntityFields: "{\"Value\":\"Test\",\"Key\":\"InitialCaseType\",\"Scope\":\"Case\"}"
scope: "All entities"
targetEntities: []
{"alertGroupIdentifiers":["IT_Threat Intelligence_TI map Domain entity to Syslog_May2024odqB87BHi4epKn26T38+oSy1FO+xCbzkbtJ1FOkcg3o=_e512dcde-9e77-4e02-8a52-5ab67197b172"],"scope":"All entities","targetEntities":[],"caseId":1405,"actionName":"Tools_Set Context Value","actionProvider":"Scripts","properties":{"ScriptName":"Tools_Set Context Value","ScriptParametersEntityFields":"{\"Value\":\"myValue\",\"Key\":\"myKey\",\"Scope\":\"Case\"}","IntegrationInstance":"bc0dae37-82dd-4a1f-8cfd-e4873f0a566b"},"isPredefinedScope":true}
LMK 🙂
Hi I am having this same issue. I captured the payload in the same way but when trying to run the POST method, I get a 400 error every time. Can you show an example of this API action working within the IDE, rather than just via the manual action button? Not sure what about the payload is malformed.
I just copied and pasted the above into my postman and it worked first time
Auth
Manual Action audit on the case wall
I then did a 'Case Comment' to prove the value of it
HTH
Hello @SoarAndy
Thank you. This worked for me on Postman as well.
can you please guide how I can get below highlighted value dynamically? I tried to search key in context value which can give me this value, but unable to find the same.
Thanks,
Suraj Kadav