# ApproveapiSwagger.ApproveApi

All URIs are relative to *https://approve.sh*

Method | HTTP request | Description
------------- | ------------- | -------------
[**createPrompt**](ApproveApi.md#createPrompt) | **POST** /prompt | Sending a prompt
[**getPrompt**](ApproveApi.md#getPrompt) | **GET** /prompt/{id} | Retrieve a prompt
[**getPromptStatus**](ApproveApi.md#getPromptStatus) | **GET** /prompt/{id}/status | Check prompt status


<a name="createPrompt"></a>
# **createPrompt**
> Prompt createPrompt(create_prompt_request)

Sending a prompt

Creates a prompt and pushes it to the user (sends via email, sms, or other supported protocols).

### Example
```javascript
var ApproveapiSwagger = require('approveapi-swagger');
var defaultClient = ApproveapiSwagger.ApiClient.instance;
// Configure HTTP basic authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.username = 'YOUR USERNAME';
apiKey.password = 'YOUR PASSWORD';

var apiInstance = new ApproveapiSwagger.ApproveApi();
var create_prompt_request = new ApproveapiSwagger.CreatePromptRequest(); // CreatePromptRequest | 
apiInstance.createPrompt(create_prompt_request).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **create_prompt_request** | [**CreatePromptRequest**](CreatePromptRequest.md)|  | 

### Return type

[**Prompt**](Prompt.md)

### Authorization

[apiKey](../README.md#apiKey)

### HTTP request headers

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

<a name="getPrompt"></a>
# **getPrompt**
> Prompt getPrompt(id, opts)

Retrieve a prompt

Retrieve the prompt object with the given ID.

### Example
```javascript
var ApproveapiSwagger = require('approveapi-swagger');
var defaultClient = ApproveapiSwagger.ApiClient.instance;
// Configure HTTP basic authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.username = 'YOUR USERNAME';
apiKey.password = 'YOUR PASSWORD';

var apiInstance = new ApproveapiSwagger.ApproveApi();
var id = "id_example"; // String | The identifier for a pending or completed prompt. This is returned when you create a prompt.
var 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.
};
apiInstance.getPrompt(id, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters

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] 

### Return type

[**Prompt**](Prompt.md)

### Authorization

[apiKey](../README.md#apiKey)

### HTTP request headers

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

<a name="getPromptStatus"></a>
# **getPromptStatus**
> PromptStatus getPromptStatus(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.

### Example
```javascript
var ApproveapiSwagger = require('approveapi-swagger');

var apiInstance = new ApproveapiSwagger.ApproveApi();
var id = "id_example"; // String | The prompt identifier.
apiInstance.getPromptStatus(id).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| The prompt identifier. | 

### Return type

[**PromptStatus**](PromptStatus.md)

### Authorization

No authorization required

### HTTP request headers

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

