All URIs are relative to https://approve.sh
| Method | HTTP request | Description |
|---|---|---|
| create_prompt | POST /prompt | Sending a prompt |
| get_prompt | GET /prompt/{id} | Retrieve a prompt |
| get_prompt_status | GET /prompt/{id}/status | Check prompt status |
Prompt create_prompt(create_prompt_request)
Sending a prompt
Creates a prompt and pushes it to the user (sends via email, sms, or other supported protocols).
# load the gem
require 'approveapi_swagger'
# setup authorization
ApproveAPISwagger.configure do |config|
# Configure HTTP basic authorization: apiKey
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'
end
api_instance = ApproveAPISwagger::ApproveApi.new
create_prompt_request = ApproveAPISwagger::CreatePromptRequest.new # CreatePromptRequest |
begin
#Sending a prompt
result = api_instance.create_prompt(create_prompt_request)
p result
rescue ApproveAPISwagger::ApiError => e
puts "Exception when calling ApproveApi->create_prompt: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| create_prompt_request | CreatePromptRequest |
- Content-Type: application/json
- Accept: application/json
Prompt get_prompt(id, opts)
Retrieve a prompt
Retrieve the prompt object with the given ID.
# load the gem
require 'approveapi_swagger'
# setup authorization
ApproveAPISwagger.configure do |config|
# Configure HTTP basic authorization: apiKey
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'
end
api_instance = ApproveAPISwagger::ApproveApi.new
id = 'id_example' # String | The identifier for a pending or completed prompt. This is returned when you create a prompt.
opts = {
long_poll: true # BOOLEAN | If true, the request waits (long-polls) until the user responds to the prompt or more than 10 minutes pass. Defaults to false.
}
begin
#Retrieve a prompt
result = api_instance.get_prompt(id, opts)
p result
rescue ApproveAPISwagger::ApiError => e
puts "Exception when calling ApproveApi->get_prompt: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | The identifier for a pending or completed prompt. This is returned when you create a prompt. | |
| long_poll | BOOLEAN | If true, the request waits (long-polls) until the user responds to the prompt or more than 10 minutes pass. Defaults to false. | [optional] |
- Content-Type: Not defined
- Accept: application/json
PromptStatus get_prompt_status(id)
Check prompt status
Returns whether a prompt has been completed by the user. This request does not require authentication, and so can be used client-side without sharing API credentials.
# load the gem
require 'approveapi_swagger'
api_instance = ApproveAPISwagger::ApproveApi.new
id = 'id_example' # String | The prompt identifier.
begin
#Check prompt status
result = api_instance.get_prompt_status(id)
p result
rescue ApproveAPISwagger::ApiError => e
puts "Exception when calling ApproveApi->get_prompt_status: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | The prompt identifier. |
No authorization required
- Content-Type: Not defined
- Accept: application/json