Class: Phyllo::PublishApi

Inherits:
Object
  • Object
show all
Defined in:
lib/phyllo/api/publish_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PublishApi

Returns a new instance of PublishApi.



17
18
19
# File 'lib/phyllo/api/publish_api.rb', line 17

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



15
16
17
# File 'lib/phyllo/api/publish_api.rb', line 15

def api_client
  @api_client
end

Instance Method Details

#v1_get_social_content_publish(id, opts = {}) ⇒ PublishContentResponse1

Check status of content publish Check status of the content publish request by ID. This is best used in combination with webhooks - you can directly take the publish ID from "CONTENTS.PUBLISH_SUCCESS", "CONTENTS.PUBLISH_READY" and "CONTENTS.PUBLISH_FAILURE" webhook notifications and pass on to this API to get the updated status of publishing request.

Parameters:

  • id (String)

    Unique ID of the publish request

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



26
27
28
29
# File 'lib/phyllo/api/publish_api.rb', line 26

def v1_get_social_content_publish(id, opts = {})
  data, _status_code, _headers = v1_get_social_content_publish_with_http_info(id, opts)
  data
end

#v1_get_social_content_publish_with_http_info(id, opts = {}) ⇒ Array<(PublishContentResponse1, Integer, Hash)>

Check status of content publish Check status of the content publish request by ID. This is best used in combination with webhooks - you can directly take the publish ID from &quot;CONTENTS.PUBLISH_SUCCESS&quot;, &quot;CONTENTS.PUBLISH_READY&quot; and &quot;CONTENTS.PUBLISH_FAILURE&quot; webhook notifications and pass on to this API to get the updated status of publishing request.

Parameters:

  • id (String)

    Unique ID of the publish request

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PublishContentResponse1, Integer, Hash)>)

    PublishContentResponse1 data, response status code and response headers



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/phyllo/api/publish_api.rb', line 36

def v1_get_social_content_publish_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PublishApi.v1_get_social_content_publish ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PublishApi.v1_get_social_content_publish"
  end
  # resource path
  local_var_path = "/v1/social/contents/publish/{id}".sub("{" + "id" + "}", CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params["Accept"] = @api_client.select_header_accept(["application/json"])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || "PublishContentResponse1"

  # auth_names
  auth_names = opts[:debug_auth_names] || ["Basic Authentication"]

  new_options = opts.merge(
    operation: :"PublishApi.v1_get_social_content_publish",
    header_params: header_params,
    query_params: query_params,
    form_params: form_params,
    body: post_body,
    auth_names: auth_names,
    return_type: return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PublishApi#v1_get_social_content_publish\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#v1_social_content_publish(opts = {}) ⇒ PublishContentResponse1

Publish content to a platform Publish content to a platform by providing the account ID. Check the [publishing content page](../../../API/publishing-content) for detailed info on how to use this API. Subscribe to the "CONTENTS.PUBLISH_SUCCESS", "CONTENTS.PUBLISH_READY" and "CONTENTS.PUBLISH_FAILURE" webhooks to receive a notification once the request is completed. With webhooks, you should use the [check status of content publish API](../reference/openapi.v1.yml/paths/~1v1~1social~1contents~1publish~1id/get) to check the detailed status of the publish request.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



89
90
91
92
# File 'lib/phyllo/api/publish_api.rb', line 89

def v1_social_content_publish(opts = {})
  data, _status_code, _headers = v1_social_content_publish_with_http_info(opts)
  data
end

#v1_social_content_publish_with_http_info(opts = {}) ⇒ Array<(PublishContentResponse1, Integer, Hash)>

Publish content to a platform Publish content to a platform by providing the account ID. Check the [publishing content page](../../../API/publishing-content) for detailed info on how to use this API. Subscribe to the &quot;CONTENTS.PUBLISH_SUCCESS&quot;, &quot;CONTENTS.PUBLISH_READY&quot; and &quot;CONTENTS.PUBLISH_FAILURE&quot; webhooks to receive a notification once the request is completed. With webhooks, you should use the [check status of content publish API](../reference/openapi.v1.yml/paths/~1v1~1social~1contents~1publish~1id/get) to check the detailed status of the publish request.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(PublishContentResponse1, Integer, Hash)>)

    PublishContentResponse1 data, response status code and response headers



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/phyllo/api/publish_api.rb', line 99

def v1_social_content_publish_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PublishApi.v1_social_content_publish ..."
  end
  # resource path
  local_var_path = "/v1/social/contents/publish"

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params["Accept"] = @api_client.select_header_accept(["application/json"])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(["application/json"])
  if !content_type.nil?
    header_params["Content-Type"] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:publish_content_request1])

  # return_type
  return_type = opts[:debug_return_type] || "PublishContentResponse1"

  # auth_names
  auth_names = opts[:debug_auth_names] || ["Basic Authentication"]

  new_options = opts.merge(
    operation: :"PublishApi.v1_social_content_publish",
    header_params: header_params,
    query_params: query_params,
    form_params: form_params,
    body: post_body,
    auth_names: auth_names,
    return_type: return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PublishApi#v1_social_content_publish\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end