Sha256: 17cbe37466c2e81bad5432ba7981cbc1a77d2ce65769eb79d940391b76f29b1c

Contents?: true

Size: 805 Bytes

Versions: 12

Compression:

Stored size: 805 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

12 entries across 12 versions & 1 rubygems

Version Path
storyblok-3.0.1 examples/management_api.rb
storyblok-3.0.0 examples/management_api.rb
storyblok-2.1.1 examples/management_api.rb
storyblok-2.1.0 examples/management_api.rb
storyblok-2.0.8 examples/management_api.rb
storyblok-2.0.7 examples/management_api.rb
storyblok-2.0.6 examples/management_api.rb
storyblok-2.0.5 examples/management_api.rb
storyblok-2.0.4 examples/management_api.rb
storyblok-2.0.3 examples/management_api.rb
storyblok-2.0.2 examples/management_api.rb
storyblok-2.0.1 examples/management_api.rb