Class: HighLevel::Resources::Blogs

Inherits:
Base
  • Object
show all
Defined in:
lib/high_level/resources/blogs.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from HighLevel::Resources::Base

Instance Method Details

#check_url_slug_exists(url_slug: nil, location_id: nil, post_id: nil, **_opts) ⇒ Object

Check url slug

The “Check url slug” API allows check the blog slug validation which is needed before publishing any blog post. Please use blogs/check-slug.readonly. you can find the POST ID from the post edit url.



12
13
14
15
16
17
18
19
# File 'lib/high_level/resources/blogs.rb', line 12

def check_url_slug_exists(url_slug: nil, location_id: nil, post_id: nil, **_opts)
  request(
    method: :get,
    path: "/blogs/posts/url-slug-exists",
    security: ["Location-Access"],
    params: { "urlSlug" => url_slug, "locationId" => location_id, "postId" => post_id }.compact
  )
end

#create_blog_post(body:, **_opts) ⇒ Object

Create Blog Post

The “Create Blog Post” API allows you create blog post for any given blog site. Please use blogs/post.write



36
37
38
39
40
41
42
43
# File 'lib/high_level/resources/blogs.rb', line 36

def create_blog_post(body:, **_opts)
  request(
    method: :post,
    path: "/blogs/posts",
    security: ["Location-Access"],
    body: body
  )
end

#get_all_blog_authors_by_location(location_id: nil, limit: nil, offset: nil, **_opts) ⇒ Object

Get all authors

The “Get all authors” Api return the blog authors for a given location ID. Please use “blogs/author.readonly”



48
49
50
51
52
53
54
55
# File 'lib/high_level/resources/blogs.rb', line 48

def get_all_blog_authors_by_location(location_id: nil, limit: nil, offset: nil, **_opts)
  request(
    method: :get,
    path: "/blogs/authors",
    security: ["Location-Access"],
    params: { "locationId" => location_id, "limit" => limit, "offset" => offset }.compact
  )
end

#get_all_categories_by_location(location_id: nil, limit: nil, offset: nil, **_opts) ⇒ Object

Get all categories

The “Get all categories” Api return the blog categoies for a given location ID. Please use “blogs/category.readonly”



60
61
62
63
64
65
66
67
# File 'lib/high_level/resources/blogs.rb', line 60

def get_all_categories_by_location(location_id: nil, limit: nil, offset: nil, **_opts)
  request(
    method: :get,
    path: "/blogs/categories",
    security: ["Location-Access"],
    params: { "locationId" => location_id, "limit" => limit, "offset" => offset }.compact
  )
end

#get_blog_post(location_id: nil, blog_id: nil, limit: nil, offset: nil, search_term: nil, status: nil, **_opts) ⇒ Object

Get Blog posts by Blog ID

The “Get Blog posts by Blog ID” API allows you get blog posts for any given blog site using blog ID.Please use blogs/posts.readonly



72
73
74
75
76
77
78
79
# File 'lib/high_level/resources/blogs.rb', line 72

def get_blog_post(location_id: nil, blog_id: nil, limit: nil, offset: nil, search_term: nil, status: nil, **_opts)
  request(
    method: :get,
    path: "/blogs/posts/all",
    security: ["Location-Access"],
    params: { "locationId" => location_id, "blogId" => blog_id, "limit" => limit, "offset" => offset, "searchTerm" => search_term, "status" => status }.compact
  )
end

#get_blogs(location_id: nil, skip: nil, limit: nil, search_term: nil, **_opts) ⇒ Object

Get Blogs by Location ID

The “Get Blogs by Location ID” API allows you get blogs using Location ID.Please use blogs/list.readonly



84
85
86
87
88
89
90
91
# File 'lib/high_level/resources/blogs.rb', line 84

def get_blogs(location_id: nil, skip: nil, limit: nil, search_term: nil, **_opts)
  request(
    method: :get,
    path: "/blogs/site/all",
    security: ["Location-Access"],
    params: { "locationId" => location_id, "skip" => skip, "limit" => limit, "searchTerm" => search_term }.compact
  )
end

#update_blog_post(body:, **_opts) ⇒ Object

Update Blog Post

The “Update Blog Post” API allows you update blog post for any given blog site. Please use blogs/post-update.write



24
25
26
27
28
29
30
31
# File 'lib/high_level/resources/blogs.rb', line 24

def update_blog_post(body:, **_opts)
  request(
    method: :put,
    path: "/blogs/posts/#{post_id}",
    security: ["Location-Access"],
    body: body
  )
end