ApproveAPISwagger
- API version: 1.0.1
The simple API to request a user's approval on anything via email + sms.
Automatically generated by the OpenAPI Generator
Building the API client library requires:
- Java 1.7+
- Maven/Gradle
To install the API client library to your local Maven repository, simply execute:
mvn clean installTo deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deployRefer to the OSSRH Guide for more information.
Add this dependency to your project's POM:
<dependency>
<groupId>com.approveapi</groupId>
<artifactId>approveapi-client</artifactId>
<version>1.0.9</version>
<scope>compile</scope>
</dependency>Add this dependency to your project's build file:
compile "com.approveapi:approveapi-client:1.0.9"At first generate the JAR by executing:
mvn clean packageThen manually install the following JARs:
target/approveapi-client-1.0.9.jartarget/lib/*.jar
Please follow the installation instruction and execute the following Java code:
importcom.approveapi.*;
importcom.approveapi.auth.*;
importcom.approveapi.*;
importcom.approveapi.ApproveApi;
importjava.io.File;
importjava.util.*;
publicclassApproveApiExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: apiKeyHttpBasicAuthapiKey = (HttpBasicAuth) defaultClient.getAuthentication("apiKey");
apiKey.setUsername("YOUR USERNAME");
apiKey.setPassword("YOUR PASSWORD");
ApproveApiapiInstance = newApproveApi();
CreatePromptRequestcreatePromptRequest = newCreatePromptRequest(); // CreatePromptRequest | try {
Promptresult = apiInstance.createPrompt(createPromptRequest);
System.out.println(result);
} catch (ApiExceptione) {
System.err.println("Exception when calling ApproveApi#createPrompt");
e.printStackTrace();
}
}
}All URIs are relative to https://approve.sh
| Class | Method | HTTP request | Description |
|---|---|---|---|
| ApproveApi | createPrompt | POST /prompt | Sending a prompt |
| ApproveApi | getPrompt | GET /prompt/{id} | Retrieve a prompt |
| ApproveApi | getPromptStatus | GET /prompt/{id}/status | Check prompt status |
Authentication schemes defined for the API:
- Type: HTTP basic authentication
It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.