All URIs are relative to https://api.sendx.io/api/v1/rest
| Method | HTTP request | Description |
|---|---|---|
| create_post | POST /post | Create blog post |
| delete_post | DELETE /post/{identifier} | Delete post |
| get_all_posts | GET /post | Get all posts |
| get_post | GET /post/{identifier} | Get post by ID |
| update_post | PUT /post/{identifier} | Update post |
create_post(rest_e_post)
Create blog post
Creates a new blog post.
require 'time'
require 'sendx-ruby-sdk'
# setup authorization
SendX.configure do |config|
# Configure API key authorization: TeamApiKey
config.api_key['X-Team-ApiKey'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['X-Team-ApiKey'] = 'Bearer'
end
api_instance = SendX::PostApi.new
rest_e_post = SendX::RestEPost.new({name: 'Summer Product Launch', post_title: 'Introducing Our New Summer Collection'}) # RestEPost |
begin
# Create blog post
result = api_instance.create_post(rest_e_post)
p result
rescue SendX::ApiError => e
puts "Error when calling PostApi->create_post: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> create_post_with_http_info(rest_e_post)
begin
# Create blog post
data, status_code, headers = api_instance.create_post_with_http_info(rest_e_post)
p status_code # => 2xx
p headers # => { ... }
p data # => <RestRPost>
rescue SendX::ApiError => e
puts "Error when calling PostApi->create_post_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| rest_e_post | RestEPost |
- Content-Type: application/json
- Accept: application/json
delete_post(identifier)
Delete post
Soft deletes a blog post. 🎯 Key Features: - Soft delete - Preserve data - Remove from listings
require 'time'
require 'sendx-ruby-sdk'
# setup authorization
SendX.configure do |config|
# Configure API key authorization: TeamApiKey
config.api_key['X-Team-ApiKey'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['X-Team-ApiKey'] = 'Bearer'
end
api_instance = SendX::PostApi.new
identifier = 'contact_BnKjkbBBS500CoBCP0oChQ' # String | Resource identifier with prefix (e.g., `contact_BnKjkbBBS500CoBCP0oChQ`) **Format:** `<prefix>_<22-character-id>`
begin
# Delete post
result = api_instance.delete_post(identifier)
p result
rescue SendX::ApiError => e
puts "Error when calling PostApi->delete_post: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> delete_post_with_http_info(identifier)
begin
# Delete post
data, status_code, headers = api_instance.delete_post_with_http_info(identifier)
p status_code # => 2xx
p headers # => { ... }
p data # => <MessageResponse>
rescue SendX::ApiError => e
puts "Error when calling PostApi->delete_post_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| identifier | String | Resource identifier with prefix (e.g., `contact_BnKjkbBBS500CoBCP0oChQ`) Format: `<prefix>_<22-character-id>` |
- Content-Type: Not defined
- Accept: application/json
<Array> get_all_posts(opts)
Get all posts
Retrieves all blog posts with pagination. 🎯 Key Features: - Filter by status - Search functionality - Sort options - Include metadata
require 'time'
require 'sendx-ruby-sdk'
# setup authorization
SendX.configure do |config|
# Configure API key authorization: TeamApiKey
config.api_key['X-Team-ApiKey'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['X-Team-ApiKey'] = 'Bearer'
end
api_instance = SendX::PostApi.new
opts = {
offset: 56, # Integer | Number of posts to skip
limit: 56 # Integer | Maximum number of posts to return
}
begin
# Get all posts
result = api_instance.get_all_posts(opts)
p result
rescue SendX::ApiError => e
puts "Error when calling PostApi->get_all_posts: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(<Array>, Integer, Hash)> get_all_posts_with_http_info(opts)
begin
# Get all posts
data, status_code, headers = api_instance.get_all_posts_with_http_info(opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <Array<RestRPost>>
rescue SendX::ApiError => e
puts "Error when calling PostApi->get_all_posts_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| offset | Integer | Number of posts to skip | [optional][default to 0] |
| limit | Integer | Maximum number of posts to return | [optional][default to 10] |
- Content-Type: Not defined
- Accept: application/json
get_post(identifier)
Get post by ID
Retrieves a specific blog post. 🎯 Key Features: - Full post content - SEO metadata - Related posts - Engagement metrics
require 'time'
require 'sendx-ruby-sdk'
# setup authorization
SendX.configure do |config|
# Configure API key authorization: TeamApiKey
config.api_key['X-Team-ApiKey'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['X-Team-ApiKey'] = 'Bearer'
end
api_instance = SendX::PostApi.new
identifier = 'contact_BnKjkbBBS500CoBCP0oChQ' # String | Resource identifier with prefix (e.g., `contact_BnKjkbBBS500CoBCP0oChQ`) **Format:** `<prefix>_<22-character-id>`
begin
# Get post by ID
result = api_instance.get_post(identifier)
p result
rescue SendX::ApiError => e
puts "Error when calling PostApi->get_post: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_post_with_http_info(identifier)
begin
# Get post by ID
data, status_code, headers = api_instance.get_post_with_http_info(identifier)
p status_code # => 2xx
p headers # => { ... }
p data # => <RestRPost>
rescue SendX::ApiError => e
puts "Error when calling PostApi->get_post_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| identifier | String | Resource identifier with prefix (e.g., `contact_BnKjkbBBS500CoBCP0oChQ`) Format: `<prefix>_<22-character-id>` |
- Content-Type: Not defined
- Accept: application/json
update_post(rest_e_post, identifier)
Update post
Updates an existing blog post. 🎯 Key Features: - Edit content - Update metadata - Change status - Modify tags/categories
require 'time'
require 'sendx-ruby-sdk'
# setup authorization
SendX.configure do |config|
# Configure API key authorization: TeamApiKey
config.api_key['X-Team-ApiKey'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['X-Team-ApiKey'] = 'Bearer'
end
api_instance = SendX::PostApi.new
rest_e_post = SendX::RestEPost.new({name: 'Summer Product Launch', post_title: 'Introducing Our New Summer Collection'}) # RestEPost |
identifier = 'contact_BnKjkbBBS500CoBCP0oChQ' # String | Resource identifier with prefix (e.g., `contact_BnKjkbBBS500CoBCP0oChQ`) **Format:** `<prefix>_<22-character-id>`
begin
# Update post
result = api_instance.update_post(rest_e_post, identifier)
p result
rescue SendX::ApiError => e
puts "Error when calling PostApi->update_post: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> update_post_with_http_info(rest_e_post, identifier)
begin
# Update post
data, status_code, headers = api_instance.update_post_with_http_info(rest_e_post, identifier)
p status_code # => 2xx
p headers # => { ... }
p data # => <RestRPost>
rescue SendX::ApiError => e
puts "Error when calling PostApi->update_post_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| rest_e_post | RestEPost | ||
| identifier | String | Resource identifier with prefix (e.g., `contact_BnKjkbBBS500CoBCP0oChQ`) Format: `<prefix>_<22-character-id>` |
- Content-Type: application/json
- Accept: application/json