Skip to content

Latest commit

 

History

History
370 lines (287 loc) · 12.7 KB

File metadata and controls

370 lines (287 loc) · 12.7 KB

PostCategoryApi

All URIs are relative to https://api.sendx.io/api/v1/rest

Method HTTP request Description
createPostCategory POST /post/category Create post category
deletePostCategory DELETE /post/category/{identifier} Delete post category
getAllPostCategories GET /post/category Get all post categories
getPostCategory GET /post/category/{identifier} Get post category by ID
updatePostCategory PUT /post/category/{identifier} Update post category

createPostCategory

RestRPostCategory createPostCategory(restEPostCategory)

Create post category

Creates a new category for organizing blog posts.

Example

// Import classes:
import sendx_java_sdk.ApiClient;
import sendx_java_sdk.ApiException;
import sendx_java_sdk.Configuration;
import sendx_java_sdk.auth.*;
import sendx_java_sdk.models.*;
import sendx_java_sdk.PostCategoryApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.sendx.io/api/v1/rest");
    
    // Configure API key authorization: TeamApiKey
    ApiKeyAuth TeamApiKey = (ApiKeyAuth) defaultClient.getAuthentication("TeamApiKey");
    TeamApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //TeamApiKey.setApiKeyPrefix("Token");

    PostCategoryApi apiInstance = new PostCategoryApi(defaultClient);
    RestEPostCategory restEPostCategory = new RestEPostCategory(); // RestEPostCategory | 
    try {
      RestRPostCategory result = apiInstance.createPostCategory(restEPostCategory);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling PostCategoryApi#createPostCategory");
      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
restEPostCategory RestEPostCategory

Return type

RestRPostCategory

Authorization

TeamApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 ✅ Category created successfully -
400 ❌ Bad Request - Invalid input data -
401 ❌ Unauthorized - Invalid or missing API key -
409 ❌ Conflict - Resource already exists -

deletePostCategory

MessageResponse deletePostCategory(identifier)

Delete post category

Soft deletes a post category.

Example

// Import classes:
import sendx_java_sdk.ApiClient;
import sendx_java_sdk.ApiException;
import sendx_java_sdk.Configuration;
import sendx_java_sdk.auth.*;
import sendx_java_sdk.models.*;
import sendx_java_sdk.PostCategoryApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.sendx.io/api/v1/rest");
    
    // Configure API key authorization: TeamApiKey
    ApiKeyAuth TeamApiKey = (ApiKeyAuth) defaultClient.getAuthentication("TeamApiKey");
    TeamApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //TeamApiKey.setApiKeyPrefix("Token");

    PostCategoryApi apiInstance = new PostCategoryApi(defaultClient);
    String identifier = "post_category_YzS1wOU20yw87UUHKxMzwn"; // String | The unique post category identifier to retrieve. - `post_category_YzS1wOU20yw87UUHKxMzwn` 
    try {
      MessageResponse result = apiInstance.deletePostCategory(identifier);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling PostCategoryApi#deletePostCategory");
      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
identifier String The unique post category identifier to retrieve. - `post_category_YzS1wOU20yw87UUHKxMzwn`

Return type

MessageResponse

Authorization

TeamApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 ✅ Category deleted successfully -
401 ❌ Unauthorized - Invalid or missing API key -
404 ❌ Not Found - Resource does not exist -
500 ❌ Internal Server Error - System error occurred -

getAllPostCategories

List<RestRPostCategory> getAllPostCategories()

Get all post categories

Retrieves all blog post categories.

Example

// Import classes:
import sendx_java_sdk.ApiClient;
import sendx_java_sdk.ApiException;
import sendx_java_sdk.Configuration;
import sendx_java_sdk.auth.*;
import sendx_java_sdk.models.*;
import sendx_java_sdk.PostCategoryApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.sendx.io/api/v1/rest");
    
    // Configure API key authorization: TeamApiKey
    ApiKeyAuth TeamApiKey = (ApiKeyAuth) defaultClient.getAuthentication("TeamApiKey");
    TeamApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //TeamApiKey.setApiKeyPrefix("Token");

    PostCategoryApi apiInstance = new PostCategoryApi(defaultClient);
    try {
      List<RestRPostCategory> result = apiInstance.getAllPostCategories();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling PostCategoryApi#getAllPostCategories");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

This endpoint does not need any parameter.

Return type

List<RestRPostCategory>

Authorization

TeamApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 ✅ Categories retrieved successfully -
401 ❌ Unauthorized - Invalid or missing API key -

getPostCategory

RestRPostCategory getPostCategory(identifier)

Get post category by ID

Retrieves a specific post category.

Example

// Import classes:
import sendx_java_sdk.ApiClient;
import sendx_java_sdk.ApiException;
import sendx_java_sdk.Configuration;
import sendx_java_sdk.auth.*;
import sendx_java_sdk.models.*;
import sendx_java_sdk.PostCategoryApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.sendx.io/api/v1/rest");
    
    // Configure API key authorization: TeamApiKey
    ApiKeyAuth TeamApiKey = (ApiKeyAuth) defaultClient.getAuthentication("TeamApiKey");
    TeamApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //TeamApiKey.setApiKeyPrefix("Token");

    PostCategoryApi apiInstance = new PostCategoryApi(defaultClient);
    String identifier = "post_category_YzS1wOU20yw87UUHKxMzwn"; // String | The unique post category identifier to retrieve. - `post_category_YzS1wOU20yw87UUHKxMzwn` 
    try {
      RestRPostCategory result = apiInstance.getPostCategory(identifier);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling PostCategoryApi#getPostCategory");
      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
identifier String The unique post category identifier to retrieve. - `post_category_YzS1wOU20yw87UUHKxMzwn`

Return type

RestRPostCategory

Authorization

TeamApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 ✅ Category retrieved successfully -
401 ❌ Unauthorized - Invalid or missing API key -
404 ❌ Not Found - Resource does not exist -

updatePostCategory

RestRPostCategory updatePostCategory(identifier, restEPostCategory)

Update post category

Updates a post category.

Example

// Import classes:
import sendx_java_sdk.ApiClient;
import sendx_java_sdk.ApiException;
import sendx_java_sdk.Configuration;
import sendx_java_sdk.auth.*;
import sendx_java_sdk.models.*;
import sendx_java_sdk.PostCategoryApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.sendx.io/api/v1/rest");
    
    // Configure API key authorization: TeamApiKey
    ApiKeyAuth TeamApiKey = (ApiKeyAuth) defaultClient.getAuthentication("TeamApiKey");
    TeamApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //TeamApiKey.setApiKeyPrefix("Token");

    PostCategoryApi apiInstance = new PostCategoryApi(defaultClient);
    String identifier = "post_category_YzS1wOU20yw87UUHKxMzwn"; // String | The unique post category identifier to retrieve. - `post_category_YzS1wOU20yw87UUHKxMzwn` 
    RestEPostCategory restEPostCategory = new RestEPostCategory(); // RestEPostCategory | 
    try {
      RestRPostCategory result = apiInstance.updatePostCategory(identifier, restEPostCategory);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling PostCategoryApi#updatePostCategory");
      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
identifier String The unique post category identifier to retrieve. - `post_category_YzS1wOU20yw87UUHKxMzwn`
restEPostCategory RestEPostCategory

Return type

RestRPostCategory

Authorization

TeamApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 ✅ Category updated successfully -
400 ❌ Bad Request - Invalid input data -
401 ❌ Unauthorized - Invalid or missing API key -
404 ❌ Not Found - Resource does not exist -
422 ❌ Unprocessable Entity - Invalid request format -
500 ❌ Internal Server Error - System error occurred -