Skip to content

cortex-cms/cortex-client-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c790189 · Jul 10, 2017
Jul 8, 2017
May 2, 2017
Jan 18, 2017
Jun 13, 2017
Jan 12, 2017
Jul 10, 2017
Apr 10, 2014
Oct 1, 2015
Apr 14, 2016
Apr 10, 2014
Jul 8, 2017

Repository files navigation

cortex-client-ruby

Build Status Gem Version

Ruby client library for cortex's API.

Constructor

require 'cortex-client'

client = Cortex::Client.new(access_token: 'access_token')

client.posts.query().each do |post|
  puts post
end

Alternatively, cortex-client will handle OAuth2 authentication for you:

require 'cortex-client'

client = Cortex::Client.new(key: 'my-app-id', secret: 'my-app-secret', base_url: 'base_url', scopes: 'view:posts view:media')
 
 client.posts.query().each do |post|
  puts post
 end

Authorization

For more information about scopes and how to obtain an application key and secret, check Cortex's authorization documentation.

Result object

Cortex::Client will return a Cortex::Result object. The following methods are available:

  • contents
  • is_error?
  • errors
  • page
  • per_page
  • total_items
  • range
  • range_start
  • range_end
  • raw_headers

Supported Endpoints

  • Users - me, get, save
  • Posts - query, get, save, delete, feed, feed/get, feed/get/released, feed/authors
  • Webpages - feed

TODO

  • Support Media endpoint