Skip to content

Latest commit

 

History

History
476 lines (376 loc) · 15.3 KB

ContactsApi.md

File metadata and controls

476 lines (376 loc) · 15.3 KB

ContactsApi

All URIs are relative to http://localhost

Method HTTP request Description
contactsCreate POST /api/v1/Contacts/contact Creates new contact
contactsDelete DELETE /api/v1/Contacts/{id} Removes contact by id
contactsGet GET /api/v1/Contacts/{id} Returns contact group by id
contactsGetByGroup GET /api/v1/Contacts/group/{groupId}/contacts Returns contacts by group id
contactsGetList GET /api/v1/Contacts/subscription/{subscriptionId}/contacts Allows to search for contacts
contactsUpdate PUT /api/v1/Contacts/{id} Updates contact by id

contactsCreate

ContactVM contactsCreate(createContactVM)

Creates new contact

Example

// Import classes:
import cloud.fastreport.ApiClient;
import cloud.fastreport.ApiException;
import cloud.fastreport.Configuration;
import cloud.fastreport.auth.*;
import cloud.fastreport.models.*;
import cloud.fastreport.client.ContactsApi;

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

    // Configure HTTP bearer authorization: JWT
    HttpBearerAuth JWT = (HttpBearerAuth) defaultClient.getAuthentication("JWT");
    JWT.setBearerToken("BEARER TOKEN");

    ContactsApi apiInstance = new ContactsApi(defaultClient);
    CreateContactVM createContactVM = new CreateContactVM(); // CreateContactVM | 
    try {
      ContactVM result = apiInstance.contactsCreate(createContactVM);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ContactsApi#contactsCreate");
      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
createContactVM CreateContactVM [optional]

Return type

ContactVM

Authorization

ApiKey, JWT

HTTP request headers

  • Content-Type: application/json, text/json, application/*+json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Contact was created -
400 Bad VM provided -
402 Subscription is outdated -
403 Not enough permissions for the operation -
404 Subscription was not found -
500 Try again, if error still here - text our support -

contactsDelete

contactsDelete(id)

Removes contact by id

Example

// Import classes:
import cloud.fastreport.ApiClient;
import cloud.fastreport.ApiException;
import cloud.fastreport.Configuration;
import cloud.fastreport.auth.*;
import cloud.fastreport.models.*;
import cloud.fastreport.client.ContactsApi;

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

    // Configure HTTP bearer authorization: JWT
    HttpBearerAuth JWT = (HttpBearerAuth) defaultClient.getAuthentication("JWT");
    JWT.setBearerToken("BEARER TOKEN");

    ContactsApi apiInstance = new ContactsApi(defaultClient);
    String id = "id_example"; // String | 
    try {
      apiInstance.contactsDelete(id);
    } catch (ApiException e) {
      System.err.println("Exception when calling ContactsApi#contactsDelete");
      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
id String

Return type

null (empty response body)

Authorization

ApiKey, JWT

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 No Content -
400 Bad id provided -
402 Subscription is outdated -
403 Not enough permissions for the operation -
404 Subscription or contact was not found -
500 Try again, if error still here - text our support -
200 Contact was deleted -

contactsGet

ContactVM contactsGet(id)

Returns contact group by id

Example

// Import classes:
import cloud.fastreport.ApiClient;
import cloud.fastreport.ApiException;
import cloud.fastreport.Configuration;
import cloud.fastreport.auth.*;
import cloud.fastreport.models.*;
import cloud.fastreport.client.ContactsApi;

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

    // Configure HTTP bearer authorization: JWT
    HttpBearerAuth JWT = (HttpBearerAuth) defaultClient.getAuthentication("JWT");
    JWT.setBearerToken("BEARER TOKEN");

    ContactsApi apiInstance = new ContactsApi(defaultClient);
    String id = "id_example"; // String | 
    try {
      ContactVM result = apiInstance.contactsGet(id);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ContactsApi#contactsGet");
      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
id String

Return type

ContactVM

Authorization

ApiKey, JWT

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Contact was found -
400 Bad id provided -
402 Subscription is outdated -
403 Not enough permissions for the operation -
404 Subscription or contact was not found -
500 Try again, if error still here - text our support -

contactsGetByGroup

ContactsVM contactsGetByGroup(groupId, skip, take)

Returns contacts by group id

Example

// Import classes:
import cloud.fastreport.ApiClient;
import cloud.fastreport.ApiException;
import cloud.fastreport.Configuration;
import cloud.fastreport.auth.*;
import cloud.fastreport.models.*;
import cloud.fastreport.client.ContactsApi;

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

    // Configure HTTP bearer authorization: JWT
    HttpBearerAuth JWT = (HttpBearerAuth) defaultClient.getAuthentication("JWT");
    JWT.setBearerToken("BEARER TOKEN");

    ContactsApi apiInstance = new ContactsApi(defaultClient);
    String groupId = "groupId_example"; // String | 
    Integer skip = 0; // Integer | 
    Integer take = 10; // Integer | 
    try {
      ContactsVM result = apiInstance.contactsGetByGroup(groupId, skip, take);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ContactsApi#contactsGetByGroup");
      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
groupId String
skip Integer [optional] [default to 0]
take Integer [optional] [default to 10]

Return type

ContactsVM

Authorization

ApiKey, JWT

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Contacts were found -
400 Bad id provided -
402 Subscription is outdated -
403 Not enough permissions for the operation -
404 Subscription or group was not found -
500 Try again, if error still here - text our support -

contactsGetList

ContactsVM contactsGetList(subscriptionId, skip, take, searchPattern)

Allows to search for contacts

Example

// Import classes:
import cloud.fastreport.ApiClient;
import cloud.fastreport.ApiException;
import cloud.fastreport.Configuration;
import cloud.fastreport.auth.*;
import cloud.fastreport.models.*;
import cloud.fastreport.client.ContactsApi;

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

    // Configure HTTP bearer authorization: JWT
    HttpBearerAuth JWT = (HttpBearerAuth) defaultClient.getAuthentication("JWT");
    JWT.setBearerToken("BEARER TOKEN");

    ContactsApi apiInstance = new ContactsApi(defaultClient);
    String subscriptionId = "subscriptionId_example"; // String | 
    Integer skip = 0; // Integer | 
    Integer take = 10; // Integer | 
    String searchPattern = "searchPattern_example"; // String | 
    try {
      ContactsVM result = apiInstance.contactsGetList(subscriptionId, skip, take, searchPattern);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ContactsApi#contactsGetList");
      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
subscriptionId String
skip Integer [optional] [default to 0]
take Integer [optional] [default to 10]
searchPattern String [optional]

Return type

ContactsVM

Authorization

ApiKey, JWT

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Contacts were found -
400 Bad id provided -
402 Subscription is outdated -
403 Not enough permissions for the operation -
404 Subscription was not found -
500 Try again, if error still here - text our support -

contactsUpdate

ContactVM contactsUpdate(id, updateContactVM)

Updates contact by id

Example

// Import classes:
import cloud.fastreport.ApiClient;
import cloud.fastreport.ApiException;
import cloud.fastreport.Configuration;
import cloud.fastreport.auth.*;
import cloud.fastreport.models.*;
import cloud.fastreport.client.ContactsApi;

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

    // Configure HTTP bearer authorization: JWT
    HttpBearerAuth JWT = (HttpBearerAuth) defaultClient.getAuthentication("JWT");
    JWT.setBearerToken("BEARER TOKEN");

    ContactsApi apiInstance = new ContactsApi(defaultClient);
    String id = "id_example"; // String | 
    UpdateContactVM updateContactVM = new UpdateContactVM(); // UpdateContactVM | 
    try {
      ContactVM result = apiInstance.contactsUpdate(id, updateContactVM);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ContactsApi#contactsUpdate");
      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
id String
updateContactVM UpdateContactVM [optional]

Return type

ContactVM

Authorization

ApiKey, JWT

HTTP request headers

  • Content-Type: application/json, text/json, application/*+json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Contact was updated -
400 Bad VM or id provided -
402 Subscription is outdated -
403 Not enough permissions for the operation -
404 Subscription or contact was not found -
500 Try again, if error still here - text our support -