SHARE
TWEET

Untitled

a guest Mar 26th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // npm install storyblok-js-client
  2. const StoryblokClient = require('storyblok-js-client')
  3.  
  4. // Initialize the client with the oauth token so you're
  5. // authenticated for the management API
  6. const Storyblok = new StoryblokClient({
  7.   oauthToken: 'YOUR_OAUTH_TOKEN'
  8. })
  9. const spaceId = 'your_space_id'
  10. let page = 1
  11.  
  12. const start = async () => {
  13.  
  14.   let storiesResponse = await Storyblok.get(`spaces/${spaceId}/stories`, {
  15.     per_page: 100,
  16.     page: page,
  17.     sort_by:'slug:asc'
  18.   })
  19.   console.log(storiesResponse.data)  
  20. }
  21.  
  22. start()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top