Skip to content

Latest commit

 

History

History
274 lines (210 loc) · 9.56 KB

InvitesApi.md

File metadata and controls

274 lines (210 loc) · 9.56 KB

InvitesApi

All URIs are relative to https://api.openai.com/v1

Method HTTP request Description
deleteInvite DELETE /organization/invites/{invite_id} Delete an invite. If the invite has already been accepted, it cannot be deleted.
inviteUser POST /organization/invites Create an invite for a user to the organization. The invite must be accepted by the user before they have access to the organization.
listInvites GET /organization/invites Returns a list of invites in the organization.
retrieveInvite GET /organization/invites/{invite_id} Retrieves an invite.

deleteInvite

InviteDeleteResponse deleteInvite(inviteId)

Delete an invite. If the invite has already been accepted, it cannot be deleted.

Example

// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.InvitesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.openai.com/v1");
    
    // Configure HTTP bearer authorization: ApiKeyAuth
    HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
    ApiKeyAuth.setBearerToken("BEARER TOKEN");

    InvitesApi apiInstance = new InvitesApi(defaultClient);
    String inviteId = "inviteId_example"; // String | The ID of the invite to delete.
    try {
      InviteDeleteResponse result = apiInstance.deleteInvite(inviteId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InvitesApi#deleteInvite");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
inviteId String The ID of the invite to delete.

Return type

InviteDeleteResponse

Authorization

ApiKeyAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Invite deleted successfully. -

inviteUser

Invite inviteUser(inviteRequest)

Create an invite for a user to the organization. The invite must be accepted by the user before they have access to the organization.

Example

// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.InvitesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.openai.com/v1");
    
    // Configure HTTP bearer authorization: ApiKeyAuth
    HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
    ApiKeyAuth.setBearerToken("BEARER TOKEN");

    InvitesApi apiInstance = new InvitesApi(defaultClient);
    InviteRequest inviteRequest = new InviteRequest(); // InviteRequest | The invite request payload.
    try {
      Invite result = apiInstance.inviteUser(inviteRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InvitesApi#inviteUser");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
inviteRequest InviteRequest The invite request payload.

Return type

Invite

Authorization

ApiKeyAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 User invited successfully. -

listInvites

InviteListResponse listInvites(limit, after)

Returns a list of invites in the organization.

Example

// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.InvitesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.openai.com/v1");
    
    // Configure HTTP bearer authorization: ApiKeyAuth
    HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
    ApiKeyAuth.setBearerToken("BEARER TOKEN");

    InvitesApi apiInstance = new InvitesApi(defaultClient);
    Integer limit = 20; // Integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. 
    String after = "after_example"; // String | A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. 
    try {
      InviteListResponse result = apiInstance.listInvites(limit, after);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InvitesApi#listInvites");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
limit Integer A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. [optional] [default to 20]
after String A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. [optional]

Return type

InviteListResponse

Authorization

ApiKeyAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Invites listed successfully. -

retrieveInvite

Invite retrieveInvite(inviteId)

Retrieves an invite.

Example

// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.InvitesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.openai.com/v1");
    
    // Configure HTTP bearer authorization: ApiKeyAuth
    HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
    ApiKeyAuth.setBearerToken("BEARER TOKEN");

    InvitesApi apiInstance = new InvitesApi(defaultClient);
    String inviteId = "inviteId_example"; // String | The ID of the invite to retrieve.
    try {
      Invite result = apiInstance.retrieveInvite(inviteId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InvitesApi#retrieveInvite");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
inviteId String The ID of the invite to retrieve.

Return type

Invite

Authorization

ApiKeyAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Invite retrieved successfully. -