-
Goal: Make an OpenAPI resource call with array request body retrieved from additionalScope. Unexpected token error no matter what I try.
-
Steps:
- Create a button in my table that makes a post request with an Order ID and a list of urls
Here is the button script:
const content_ids = currentSourceRow.content_items.map(item => item.content_id);
console.log('content_ids:', content_ids);
var resp = await AcceptImages.trigger({
additionalScope: {
content_ids_to_approve: content_ids,
approve_images_order_id: currentSourceRow.order_id
}
});
return resp;
- Create a query AcceptOrder that calls OpenAPI (fastapi) route.
Here, I get Unexpected token error: AcceptImages failed (0.322s):Unexpected token { in JSON at position 1
.
I've also tried just putting content_ids_to_approve
as well as {{content_ids_to_approve}}
. I've also tried using Object.Values and Array.from in the Button script, but still same error.
I've tested by just inputting a raw list in the request and it worked fine:
[
"url1",
"url2",
]
I've confirmed the API is just expecting an array of strings:
Any ideas here? Am I correctly using the additionalScope? Am I messing up the formatting somehow? Something different I'm completely missing?