Skip to content

Instantly share code, notes, and snippets.

@DominikAngerer
Created October 8, 2018 08:10
Show Gist options
  • Select an option

  • Save DominikAngerer/7e9abaf5d0017af69bb408a6bfcd7dbe to your computer and use it in GitHub Desktop.

Select an option

Save DominikAngerer/7e9abaf5d0017af69bb408a6bfcd7dbe to your computer and use it in GitHub Desktop.
var request = require("request");
var options = { method: 'POST',
url: 'https://api.storyblok.com/v1/spaces/YOUR_SPACE_ID/stories',
headers:
{ Authorization: 'YOUR_AUTH_TOKEN',
'Content-Type': 'application/json',
Accept: 'application/json' },
body: { story:
{ name: 'Story 1',
content: {
//... your content json
},
slug: 'demo' }
},
json: true };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment