Skip to content

Latest commit

 

History

History
354 lines (246 loc) · 9.04 KB

JWTTemplatesApi.md

File metadata and controls

354 lines (246 loc) · 9.04 KB

ClerkHttpClient::JWTTemplatesApi

All URIs are relative to https://api.clerk.com/v1

Method HTTP request Description
create_jwt_template POST /jwt_templates Create a JWT template
delete_jwt_template DELETE /jwt_templates/{template_id} Delete a Template
get_jwt_template GET /jwt_templates/{template_id} Retrieve a template
list_jwt_templates GET /jwt_templates List all templates
update_jwt_template PATCH /jwt_templates/{template_id} Update a JWT template

create_jwt_template

create_jwt_template(create_jwt_template_request)

Create a JWT template

Create a new JWT template

Examples

require 'time'
require 'clerk-http-client'
# setup authorization
ClerkHttpClient.configure do |config|
  # Configure Bearer authorization (sk_<environment>_<secret value>): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = ClerkHttpClient::JWTTemplatesApi.new
create_jwt_template_request = ClerkHttpClient::CreateJWTTemplateRequest.new # CreateJWTTemplateRequest | 

begin
  # Create a JWT template
  result = api_instance.create_jwt_template(create_jwt_template_request)
  p result
rescue ClerkHttpClient::ApiError => e
  puts "Error when calling JWTTemplatesApi->create_jwt_template: #{e}"
end

Using the create_jwt_template_with_http_info variant

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

<Array(, Integer, Hash)> create_jwt_template_with_http_info(create_jwt_template_request)

begin
  # Create a JWT template
  data, status_code, headers = api_instance.create_jwt_template_with_http_info(create_jwt_template_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <JWTTemplate>
rescue ClerkHttpClient::ApiError => e
  puts "Error when calling JWTTemplatesApi->create_jwt_template_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
create_jwt_template_request CreateJWTTemplateRequest

Return type

JWTTemplate

Authorization

bearerAuth

HTTP request headers

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

delete_jwt_template

delete_jwt_template(template_id)

Delete a Template

Examples

require 'time'
require 'clerk-http-client'
# setup authorization
ClerkHttpClient.configure do |config|
  # Configure Bearer authorization (sk_<environment>_<secret value>): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = ClerkHttpClient::JWTTemplatesApi.new
template_id = 'template_id_example' # String | JWT Template ID

begin
  # Delete a Template
  result = api_instance.delete_jwt_template(template_id)
  p result
rescue ClerkHttpClient::ApiError => e
  puts "Error when calling JWTTemplatesApi->delete_jwt_template: #{e}"
end

Using the delete_jwt_template_with_http_info variant

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

<Array(, Integer, Hash)> delete_jwt_template_with_http_info(template_id)

begin
  # Delete a Template
  data, status_code, headers = api_instance.delete_jwt_template_with_http_info(template_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <DeletedObject>
rescue ClerkHttpClient::ApiError => e
  puts "Error when calling JWTTemplatesApi->delete_jwt_template_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
template_id String JWT Template ID

Return type

DeletedObject

Authorization

bearerAuth

HTTP request headers

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

get_jwt_template

get_jwt_template(template_id)

Retrieve a template

Retrieve the details of a given JWT template

Examples

require 'time'
require 'clerk-http-client'
# setup authorization
ClerkHttpClient.configure do |config|
  # Configure Bearer authorization (sk_<environment>_<secret value>): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = ClerkHttpClient::JWTTemplatesApi.new
template_id = 'template_id_example' # String | JWT Template ID

begin
  # Retrieve a template
  result = api_instance.get_jwt_template(template_id)
  p result
rescue ClerkHttpClient::ApiError => e
  puts "Error when calling JWTTemplatesApi->get_jwt_template: #{e}"
end

Using the get_jwt_template_with_http_info variant

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

<Array(, Integer, Hash)> get_jwt_template_with_http_info(template_id)

begin
  # Retrieve a template
  data, status_code, headers = api_instance.get_jwt_template_with_http_info(template_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <JWTTemplate>
rescue ClerkHttpClient::ApiError => e
  puts "Error when calling JWTTemplatesApi->get_jwt_template_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
template_id String JWT Template ID

Return type

JWTTemplate

Authorization

bearerAuth

HTTP request headers

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

list_jwt_templates

<Array> list_jwt_templates

List all templates

Examples

require 'time'
require 'clerk-http-client'
# setup authorization
ClerkHttpClient.configure do |config|
  # Configure Bearer authorization (sk_<environment>_<secret value>): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = ClerkHttpClient::JWTTemplatesApi.new

begin
  # List all templates
  result = api_instance.list_jwt_templates
  p result
rescue ClerkHttpClient::ApiError => e
  puts "Error when calling JWTTemplatesApi->list_jwt_templates: #{e}"
end

Using the list_jwt_templates_with_http_info variant

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

<Array(<Array>, Integer, Hash)> list_jwt_templates_with_http_info

begin
  # List all templates
  data, status_code, headers = api_instance.list_jwt_templates_with_http_info
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Array<JWTTemplate>>
rescue ClerkHttpClient::ApiError => e
  puts "Error when calling JWTTemplatesApi->list_jwt_templates_with_http_info: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

Array<JWTTemplate>

Authorization

bearerAuth

HTTP request headers

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

update_jwt_template

update_jwt_template(template_id, create_jwt_template_request)

Update a JWT template

Updates an existing JWT template

Examples

require 'time'
require 'clerk-http-client'
# setup authorization
ClerkHttpClient.configure do |config|
  # Configure Bearer authorization (sk_<environment>_<secret value>): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = ClerkHttpClient::JWTTemplatesApi.new
template_id = 'template_id_example' # String | The ID of the JWT template to update
create_jwt_template_request = ClerkHttpClient::CreateJWTTemplateRequest.new # CreateJWTTemplateRequest | 

begin
  # Update a JWT template
  result = api_instance.update_jwt_template(template_id, create_jwt_template_request)
  p result
rescue ClerkHttpClient::ApiError => e
  puts "Error when calling JWTTemplatesApi->update_jwt_template: #{e}"
end

Using the update_jwt_template_with_http_info variant

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

<Array(, Integer, Hash)> update_jwt_template_with_http_info(template_id, create_jwt_template_request)

begin
  # Update a JWT template
  data, status_code, headers = api_instance.update_jwt_template_with_http_info(template_id, create_jwt_template_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <JWTTemplate>
rescue ClerkHttpClient::ApiError => e
  puts "Error when calling JWTTemplatesApi->update_jwt_template_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
template_id String The ID of the JWT template to update
create_jwt_template_request CreateJWTTemplateRequest

Return type

JWTTemplate

Authorization

bearerAuth

HTTP request headers

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