Sha256: d9f052aab67672b382a3eb7dd5f96aee35f058c6c724af2f343bfea55776b7d8

Contents?: true

Size: 811 Bytes

Versions: 2

Compression:

Stored size: 811 Bytes

Contents

# bundle exec ruby examples/management_api.rb

require 'storyblok'

logger = Logger.new(STDOUT)

client = Storyblok::Client.new(
  token: 'A5uTnm0GXLBLhwaGrhHdQwtt',
  oauth_token: 'OAUTH_TOKEN',
  logger: logger
)

spaces = client.get('spaces')['data']['spaces']
space = spaces.first

p client.get("spaces/#{space['id']}")['data']['space']
story_res = client.post("spaces/#{space['id']}/stories", { story: { name: 'new', slug: "new" } })['data']

10.times do |index|
  client.get("spaces/#{space['id']}/stories/#{story_res['story']['id']}")
  puts index
end

p client.put("spaces/#{space['id']}/stories/#{story_res['story']['id']}", { story: { name: 'new123' } })['data']

10.times do |index|
  client.story('new')
  puts index
end

p client.delete("spaces/#{space['id']}/stories/#{story_res['story']['id']}")

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
storyblok-3.2.0 examples/management_api.rb
storyblok-3.1.0 examples/management_api.rb