Custom APIs

Use the APIs dashboard

ACPT brings you a complete API REST platform to handle (and eventually automate) every available ACPT operation.

Navigate to ACPT tools and then click on API dashboard:

The APIs let you run these operations:

  • Manage ACPT custom post types

  • Manage meta box and fields

  • Manage taxonomies

  • Manage WooCommerce product data

  • Advanced filter posts by query

Security

You can use two types of authentication methods:

  • Basic authorization

  • API keys authentication

Basic authorization

The first type of authentication is the Basic one: you can use your regular WordPress username and password.

Attach this to the headers of the HTTP request:

authorization: Basic ZmZmOmZkc2Zkcw==

Where ZmZmOmZkc2Zkcw== is the username:password string in a base64 encoded format.

API keys authentication

If you don't have one API key click on the Generate API key button. The API key-secret pair will be displayed in a popup.

Please note that the secret key will no longer be displayed, so please take note of it. Eventually, you can regenerate your API keys.

Now you are ready to use the APIs.

Attach the obtained keys to the headers of the HTTP request:

acpt-api-key: ec73745e7f3c-bb6121f62e92

It's strongly recommended to use the API keys authentication method.

APIs dashboard

If you know OpenApi and Swagger UI this dashboard will look familiar to you.

If you don't, please look at this complete guide on how to use Swagger UI.

Feel free to use the playground.

Data validation and response

Every exposed endpoint is documented. You can find:

  • The HTTP Verb

  • The request structure payload (with examples)

  • The response structure HTTP codes with payloads (with examples)

As the APIs produce and consume JSON, every request is validated against the corresponding schema.

If the request JSON payload is invalid the API will return a 500 HTTP code response.

You can find the whole API schema object calling this endpoint:

/wp-json/acpt/v1/schema

Last updated