All URIs are relative to https://api.clerk.com/v1
Method | HTTP request | Description |
---|---|---|
create_phone_number | POST /phone_numbers | Create a phone number |
delete_phone_number | DELETE /phone_numbers/{phone_number_id} | Delete a phone number |
get_phone_number | GET /phone_numbers/{phone_number_id} | Retrieve a phone number |
update_phone_number | PATCH /phone_numbers/{phone_number_id} | Update a phone number |
create_phone_number(opts)
Create a phone number
Create a new phone number
require 'time'
require 'clerk-sdk-ruby-backend'
# setup authorization
ClerkBackend.configure do |config|
# Configure Bearer authorization (sk_<environment>_<secret value>): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = ClerkBackend::PhoneNumbersApi.new
opts = {
create_phone_number_request: ClerkBackend::CreatePhoneNumberRequest.new # CreatePhoneNumberRequest |
}
begin
# Create a phone number
result = api_instance.create_phone_number(opts)
p result
rescue ClerkBackend::ApiError => e
puts "Error when calling PhoneNumbersApi->create_phone_number: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> create_phone_number_with_http_info(opts)
begin
# Create a phone number
data, status_code, headers = api_instance.create_phone_number_with_http_info(opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <PhoneNumber>
rescue ClerkBackend::ApiError => e
puts "Error when calling PhoneNumbersApi->create_phone_number_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
create_phone_number_request | CreatePhoneNumberRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
delete_phone_number(phone_number_id)
Delete a phone number
Delete the phone number with the given ID
require 'time'
require 'clerk-sdk-ruby-backend'
# setup authorization
ClerkBackend.configure do |config|
# Configure Bearer authorization (sk_<environment>_<secret value>): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = ClerkBackend::PhoneNumbersApi.new
phone_number_id = 'phone_number_id_example' # String | The ID of the phone number to delete
begin
# Delete a phone number
result = api_instance.delete_phone_number(phone_number_id)
p result
rescue ClerkBackend::ApiError => e
puts "Error when calling PhoneNumbersApi->delete_phone_number: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> delete_phone_number_with_http_info(phone_number_id)
begin
# Delete a phone number
data, status_code, headers = api_instance.delete_phone_number_with_http_info(phone_number_id)
p status_code # => 2xx
p headers # => { ... }
p data # => <DeletedObject>
rescue ClerkBackend::ApiError => e
puts "Error when calling PhoneNumbersApi->delete_phone_number_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
phone_number_id | String | The ID of the phone number to delete |
- Content-Type: Not defined
- Accept: application/json
get_phone_number(phone_number_id)
Retrieve a phone number
Returns the details of a phone number
require 'time'
require 'clerk-sdk-ruby-backend'
# setup authorization
ClerkBackend.configure do |config|
# Configure Bearer authorization (sk_<environment>_<secret value>): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = ClerkBackend::PhoneNumbersApi.new
phone_number_id = 'phone_number_id_example' # String | The ID of the phone number to retrieve
begin
# Retrieve a phone number
result = api_instance.get_phone_number(phone_number_id)
p result
rescue ClerkBackend::ApiError => e
puts "Error when calling PhoneNumbersApi->get_phone_number: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_phone_number_with_http_info(phone_number_id)
begin
# Retrieve a phone number
data, status_code, headers = api_instance.get_phone_number_with_http_info(phone_number_id)
p status_code # => 2xx
p headers # => { ... }
p data # => <PhoneNumber>
rescue ClerkBackend::ApiError => e
puts "Error when calling PhoneNumbersApi->get_phone_number_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
phone_number_id | String | The ID of the phone number to retrieve |
- Content-Type: Not defined
- Accept: application/json
update_phone_number(phone_number_id, opts)
Update a phone number
Updates a phone number
require 'time'
require 'clerk-sdk-ruby-backend'
# setup authorization
ClerkBackend.configure do |config|
# Configure Bearer authorization (sk_<environment>_<secret value>): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = ClerkBackend::PhoneNumbersApi.new
phone_number_id = 'phone_number_id_example' # String | The ID of the phone number to update
opts = {
update_phone_number_request: ClerkBackend::UpdatePhoneNumberRequest.new # UpdatePhoneNumberRequest |
}
begin
# Update a phone number
result = api_instance.update_phone_number(phone_number_id, opts)
p result
rescue ClerkBackend::ApiError => e
puts "Error when calling PhoneNumbersApi->update_phone_number: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> update_phone_number_with_http_info(phone_number_id, opts)
begin
# Update a phone number
data, status_code, headers = api_instance.update_phone_number_with_http_info(phone_number_id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <PhoneNumber>
rescue ClerkBackend::ApiError => e
puts "Error when calling PhoneNumbersApi->update_phone_number_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
phone_number_id | String | The ID of the phone number to update | |
update_phone_number_request | UpdatePhoneNumberRequest | [optional] |
- Content-Type: application/json
- Accept: application/json