Skip to content

Latest commit

 

History

History
376 lines (273 loc) · 11.9 KB

WebhookApi.md

File metadata and controls

376 lines (273 loc) · 11.9 KB

TCAClient::WebhookApi

All URIs are relative to https://app-us.turnitin.com/api/v1

Method HTTP request Description
delete_webhook DELETE /webhooks/{id} Delete Webhook endpoint
get_webhook GET /webhooks/{id} Get Webhook endpoint info
update_webhook PATCH /webhooks/{id} Update Webhook endpoint info
webhooks_get GET /webhooks List registered Webhook endpoints
webhooks_post POST /webhooks Register a Webhook endpoint

delete_webhook

delete_webhook(x_turnitin_integration_name, x_turnitin_integration_version, id)

Delete Webhook endpoint

Examples

require 'time'
require 'tca_client'
# setup authorization
TCAClient.configure do |config|
  # Configure API key authorization: api_key
  config.api_key['api_key'] = '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['api_key'] = 'Bearer'
end

api_instance = TCAClient::WebhookApi.new
x_turnitin_integration_name = 'myintegration' # String | a human readable string representing the type of integration being used
x_turnitin_integration_version = 'v1.0.2' # String | the version of the integration platform being used
id = 'id_example' # String | 

begin
  # Delete Webhook endpoint
  api_instance.delete_webhook(x_turnitin_integration_name, x_turnitin_integration_version, id)
rescue TCAClient::ApiError => e
  puts "Error when calling WebhookApi->delete_webhook: #{e}"
end

Using the delete_webhook_with_http_info variant

This returns an Array which contains the response data (nil in this case), status code and headers.

<Array(nil, Integer, Hash)> delete_webhook_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, id)

begin
  # Delete Webhook endpoint
  data, status_code, headers = api_instance.delete_webhook_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => nil
rescue TCAClient::ApiError => e
  puts "Error when calling WebhookApi->delete_webhook_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
x_turnitin_integration_name String a human readable string representing the type of integration being used
x_turnitin_integration_version String the version of the integration platform being used
id String

Return type

nil (empty response body)

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_webhook

get_webhook(x_turnitin_integration_name, x_turnitin_integration_version, id)

Get Webhook endpoint info

Examples

require 'time'
require 'tca_client'
# setup authorization
TCAClient.configure do |config|
  # Configure API key authorization: api_key
  config.api_key['api_key'] = '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['api_key'] = 'Bearer'
end

api_instance = TCAClient::WebhookApi.new
x_turnitin_integration_name = 'myintegration' # String | a human readable string representing the type of integration being used
x_turnitin_integration_version = 'v1.0.2' # String | the version of the integration platform being used
id = 'id_example' # String | 

begin
  # Get Webhook endpoint info
  result = api_instance.get_webhook(x_turnitin_integration_name, x_turnitin_integration_version, id)
  p result
rescue TCAClient::ApiError => e
  puts "Error when calling WebhookApi->get_webhook: #{e}"
end

Using the get_webhook_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_webhook_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, id)

begin
  # Get Webhook endpoint info
  data, status_code, headers = api_instance.get_webhook_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Webhook>
rescue TCAClient::ApiError => e
  puts "Error when calling WebhookApi->get_webhook_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
x_turnitin_integration_name String a human readable string representing the type of integration being used
x_turnitin_integration_version String the version of the integration platform being used
id String

Return type

Webhook

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

update_webhook

update_webhook(x_turnitin_integration_name, x_turnitin_integration_version, id, data)

Update Webhook endpoint info

Examples

require 'time'
require 'tca_client'
# setup authorization
TCAClient.configure do |config|
  # Configure API key authorization: api_key
  config.api_key['api_key'] = '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['api_key'] = 'Bearer'
end

api_instance = TCAClient::WebhookApi.new
x_turnitin_integration_name = 'myintegration' # String | a human readable string representing the type of integration being used
x_turnitin_integration_version = 'v1.0.2' # String | the version of the integration platform being used
id = 'id_example' # String | 
data = TCAClient::WebhookPathRequest.new({event_types: ['SUBMISSION_COMPLETE']}) # WebhookPathRequest | 

begin
  # Update Webhook endpoint info
  result = api_instance.update_webhook(x_turnitin_integration_name, x_turnitin_integration_version, id, data)
  p result
rescue TCAClient::ApiError => e
  puts "Error when calling WebhookApi->update_webhook: #{e}"
end

Using the update_webhook_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> update_webhook_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, id, data)

begin
  # Update Webhook endpoint info
  data, status_code, headers = api_instance.update_webhook_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, id, data)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Webhook>
rescue TCAClient::ApiError => e
  puts "Error when calling WebhookApi->update_webhook_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
x_turnitin_integration_name String a human readable string representing the type of integration being used
x_turnitin_integration_version String the version of the integration platform being used
id String
data WebhookPathRequest

Return type

Webhook

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

webhooks_get

<Array> webhooks_get(x_turnitin_integration_name, x_turnitin_integration_version)

List registered Webhook endpoints

Examples

require 'time'
require 'tca_client'
# setup authorization
TCAClient.configure do |config|
  # Configure API key authorization: api_key
  config.api_key['api_key'] = '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['api_key'] = 'Bearer'
end

api_instance = TCAClient::WebhookApi.new
x_turnitin_integration_name = 'myintegration' # String | a human readable string representing the type of integration being used
x_turnitin_integration_version = 'v1.0.2' # String | the version of the integration platform being used

begin
  # List registered Webhook endpoints
  result = api_instance.webhooks_get(x_turnitin_integration_name, x_turnitin_integration_version)
  p result
rescue TCAClient::ApiError => e
  puts "Error when calling WebhookApi->webhooks_get: #{e}"
end

Using the webhooks_get_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(<Array>, Integer, Hash)> webhooks_get_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version)

begin
  # List registered Webhook endpoints
  data, status_code, headers = api_instance.webhooks_get_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Array<Webhook>>
rescue TCAClient::ApiError => e
  puts "Error when calling WebhookApi->webhooks_get_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
x_turnitin_integration_name String a human readable string representing the type of integration being used
x_turnitin_integration_version String the version of the integration platform being used

Return type

Array<Webhook>

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

webhooks_post

webhooks_post(x_turnitin_integration_name, x_turnitin_integration_version, data)

Register a Webhook endpoint

Examples

require 'time'
require 'tca_client'
# setup authorization
TCAClient.configure do |config|
  # Configure API key authorization: api_key
  config.api_key['api_key'] = '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['api_key'] = 'Bearer'
end

api_instance = TCAClient::WebhookApi.new
x_turnitin_integration_name = 'myintegration' # String | a human readable string representing the type of integration being used
x_turnitin_integration_version = 'v1.0.2' # String | the version of the integration platform being used
data = TCAClient::WebhookWithSecret.new({signing_secret: File.new('/path/to/some/file'), url: 'url_example', event_types: ['SUBMISSION_COMPLETE']}) # WebhookWithSecret | 

begin
  # Register a Webhook endpoint
  result = api_instance.webhooks_post(x_turnitin_integration_name, x_turnitin_integration_version, data)
  p result
rescue TCAClient::ApiError => e
  puts "Error when calling WebhookApi->webhooks_post: #{e}"
end

Using the webhooks_post_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> webhooks_post_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, data)

begin
  # Register a Webhook endpoint
  data, status_code, headers = api_instance.webhooks_post_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, data)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Webhook>
rescue TCAClient::ApiError => e
  puts "Error when calling WebhookApi->webhooks_post_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
x_turnitin_integration_name String a human readable string representing the type of integration being used
x_turnitin_integration_version String the version of the integration platform being used
data WebhookWithSecret

Return type

Webhook

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json