module Voog::API::Articles

Voog Articles API methods.

@see www.voog.com/developers/api/resources/articles

Public Instance Methods

article(id, params = {}) click to toggle source

Get a single article

@see www.voog.com/developers/api/resources/articles#get_article

# File lib/voog_api/api/articles.rb, line 19
def article(id, params = {})
  get "articles/#{id}", {query: params}
end
article_content(article_id, id, params = {}) click to toggle source

Get a single content for article

@see www.voog.com/developers/api/resources/contents#get_content

# File lib/voog_api/api/articles.rb, line 81
def article_content(article_id, id, params = {})
  content(Voog::API::Contents::ParentKind::Article, article_id, id, params)
end
article_contents(id, params = {}) click to toggle source

List contents for article

@see www.voog.com/developers/api/resources/contents#get_contents

# File lib/voog_api/api/articles.rb, line 74
def article_contents(id, params = {})
  contents(Voog::API::Contents::ParentKind::Article, id, params)
end
articles(params = {}) click to toggle source

List articles

@see www.voog.com/developers/api/resources/articles#get_articles

# File lib/voog_api/api/articles.rb, line 12
def articles(params = {})
  paginate 'articles', {query: params}
end
create_article(data) click to toggle source

Create an article

@see www.voog.com/developers/api/resources/articles#create_article

# File lib/voog_api/api/articles.rb, line 26
def create_article(data)
  post 'articles', data
end
create_article_content(article_id, data) click to toggle source

Create an article content for article

@see www.voog.com/developers/api/resources/contents#create_content

# File lib/voog_api/api/articles.rb, line 88
def create_article_content(article_id, data)
  create_content(Voog::API::Contents::ParentKind::Article, article_id, data)
end
delete_article(id) click to toggle source

Delete an article

@see www.voog.com/developers/api/resources/articles#remove_article

# File lib/voog_api/api/articles.rb, line 47
def delete_article(id)
  delete "articles/#{id}"
end
delete_article_content(article_id, id) click to toggle source

Delete a content from article

@see www.voog.com/developers/api/resources/contents#delete_content

# File lib/voog_api/api/articles.rb, line 95
def delete_article_content(article_id, id)
  delete_content(Voog::API::Contents::ParentKind::Article, article_id, id)
end
delete_article_data(article_id, id) click to toggle source

Delete a key from article data field

@param id [String] key in data field

@see www.voog.com/developers/api/resources/articles#delete_article_custom_field

# File lib/voog_api/api/articles.rb, line 65
def delete_article_data(article_id, id)
  delete "articles/#{article_id}/data/#{id}"
end
move_article_content(article_id, id, params = {}) click to toggle source

Reorder/move article content inside/between content areas and parent objects

@see www.voog.com/developers/api/resources/contents#relocate_content

# File lib/voog_api/api/articles.rb, line 102
def move_article_content(article_id, id, params = {})
  move_content(Voog::API::Contents::ParentKind::Article, article_id, id, params)
end
patch_article(id, data) click to toggle source

Patch an article

@see www.voog.com/developers/api/resources/articles#patch_article

# File lib/voog_api/api/articles.rb, line 40
def patch_article(id, data)
  patch "articles/#{id}", data
end
update_article(id, data) click to toggle source

Update an article

@see www.voog.com/developers/api/resources/articles#update_article

# File lib/voog_api/api/articles.rb, line 33
def update_article(id, data)
  put "articles/#{id}", data
end
update_article_data(article_id, id, data) click to toggle source

Update/create a key in article data field

@param id [String] key in data field

@see www.voog.com/developers/api/resources/articles#update_article_data_field

# File lib/voog_api/api/articles.rb, line 56
def update_article_data(article_id, id, data)
  put "articles/#{article_id}/data/#{id}", {value: data}
end