Skip to content

Latest commit

 

History

History
136 lines (92 loc) · 7.36 KB

File metadata and controls

136 lines (92 loc) · 7.36 KB

Clients

Overview

Available Operations

  • list - List all clients ⚠️ Deprecated
  • verify - Verify a client
  • get - Get a client

list

Returns a list of all clients. The clients are returned sorted by creation date, with the newest clients appearing first. Warning: the endpoint is being deprecated and will be removed in future versions.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

require 'clerk_sdk_ruby'

Models = ::Clerk::Models
s = ::Clerk::OpenAPIClient.new(
  bearer_auth: '<YOUR_BEARER_TOKEN_HERE>'
)
res = s.clients.list(limit: 10, offset: 0)

unless res.client_list.nil?
  # handle response
end

Parameters

Parameter Type Required Description
paginated Crystalline::Nilable.new(Crystalline::Boolean.new) Whether to paginate the results.
If true, the results will be paginated.
If false, the results will not be paginated.
limit Crystalline::Nilable.new(::Integer) Applies a limit to the number of results returned.
Can be used for paginating the results together with offset.
offset Crystalline::Nilable.new(::Integer) Skip the first offset results when paginating.
Needs to be an integer greater or equal to zero.
To be used in conjunction with limit.

Response

Crystalline::Nilable.new(Models::Operations::GetClientListResponse)

Errors

Error Type Status Code Content Type
Models::Errors::ClerkErrors 400, 401, 410, 422 application/json
Errors::APIError 4XX, 5XX */*

verify

Verifies the client in the provided token

Example Usage

require 'clerk_sdk_ruby'

Models = ::Clerk::Models
s = ::Clerk::OpenAPIClient.new(
  bearer_auth: '<YOUR_BEARER_TOKEN_HERE>'
)

req = Models::Operations::VerifyClientRequest.new(
  token: 'jwt_token_example'
)
res = s.clients.verify(request: req)

unless res.client.nil?
  # handle response
end

Parameters

Parameter Type Required Description
request Models::Operations::VerifyClientRequest ✔️ The request object to use for the request.

Response

Crystalline::Nilable.new(Models::Operations::VerifyClientResponse)

Errors

Error Type Status Code Content Type
Models::Errors::ClerkErrors 400, 401, 404 application/json
Errors::APIError 4XX, 5XX */*

get

Returns the details of a client.

Example Usage

require 'clerk_sdk_ruby'

Models = ::Clerk::Models
s = ::Clerk::OpenAPIClient.new(
  bearer_auth: '<YOUR_BEARER_TOKEN_HERE>'
)
res = s.clients.get(client_id: 'cli_123456789')

unless res.client.nil?
  # handle response
end

Parameters

Parameter Type Required Description
client_id ::String ✔️ Client ID.

Response

Crystalline::Nilable.new(Models::Operations::GetClientResponse)

Errors

Error Type Status Code Content Type
Models::Errors::ClerkErrors 400, 401, 404 application/json
Errors::APIError 4XX, 5XX */*