Can I get the JSON output from the code I wrote using the NodeJS SDK?

I wrote code using the NodeJS SDK that generates a fairly complex video. I have later decided to use Zapier to create this video out of answers from SurveySparrow. In Zapier I can POST to the ShotStack API but I have to provide the JSON payload directly. Is there a way in which I will not have to re-write the whole JSON from scratch, maybe getting the JSON as an output from the code I wrote in the SDK?

Hi @femxxhealth,

Yes you can get the JSON of any template you have built by using the UUID of a completed render and polling the API to check the render status by adding timeline=true as a parameter. The JSON will then be available inside of the data property.

curl -X GET \
     -H "Content-Type: application/json" \
     -H "x-api-key: ptmpOiyKgGYMnnONwvXH7FHzDGOazrIjaEDUS7Cf" \

This would return the following:

1 Like

You can also just dump any object created using the SDK using JSON.stringify:

const edit = new Shotstack.Edit;

console.log(JSON.stringify(edit, null, 2));

That will just output the JSON to the terminal, or you could write it to a file etc…

1 Like

Thank you so much, this saved me a lot of time :slight_smile:

1 Like

Thanks a lot! Very helpful :grinning:

1 Like