Skip to content

Latest commit

 

History

History
143 lines (93 loc) · 3.43 KB

README.md

File metadata and controls

143 lines (93 loc) · 3.43 KB

approveapi-client

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

Requirements

Building the API client library requires:

  1. Java 1.7+
  2. Maven/Gradle

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

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>

Gradle users

Add this dependency to your project's build file:

compile "com.approveapi:approveapi-client:1.0.9"

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/approveapi-client-1.0.9.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

import com.approveapi.*;
import com.approveapi.auth.*;
import com.approveapi.*;
import com.approveapi.ApproveApi;

import java.io.File;
import java.util.*;

public class ApproveApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure HTTP basic authorization: apiKey
        HttpBasicAuth apiKey = (HttpBasicAuth) defaultClient.getAuthentication("apiKey");
        apiKey.setUsername("YOUR USERNAME");
        apiKey.setPassword("YOUR PASSWORD");

        ApproveApi apiInstance = new ApproveApi();
        CreatePromptRequest createPromptRequest = new CreatePromptRequest(); // CreatePromptRequest | 
        try {
            Prompt result = apiInstance.createPrompt(createPromptRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ApproveApi#createPrompt");
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

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

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

apiKey

  • Type: HTTP basic authentication

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

dev@approveapi.com