I’m trying to make a PUT request (using fetch) to the geometry backend API to set the contents of a direct text input within my GH script as JSON data. The request seems to be successful, but the outputs are unchanged which make me think the parameters aren’t sent correctly. I’m probably missing something obvious, but any help would be appreciated. Code snippet below
Do you want to compute an export or the outputs of a model?
Your request body looks like an export request, but I see two issues:
exports.id is not set
All parameter values must be stringified (i.e. JSON.stringify in your case)
You might want to consider using our SDK, which will simplify what you want to achieve. The SDK offers a function utils.submitAndWaitForExport which allows you to submit an export request and wait for the result.
Thank you for the reply. I’m only trying to compute the outputs of the model, which in this case is a single “direct data output” that also happens to be a JSON object. I’ve copied in a link to my shape diver model, the input for my parameter and the output I receive. I’d really rather keep it set up as it for now if possible, so if you can offer any advice on what i’m doing wrong it would be really appreciated.
I believe that’s what im doing already, see image below - let me know if i’ve missed anything. Note how the grid spacing does not update. Worth also noting that if I change the value directly in the shapediver library the computation works just fine.