All Collections
FAQ
What can I do with the API?
What can I do with the API?

Create posts and generate AI copy

Joe Sutcliffe avatar
Written by Joe Sutcliffe
Updated over a week ago

Using the Ocoya API

The Ocoya API is a RESTful and fully-featured API that streamlines organic social media management from a single place. With the Ocoya API, you can create draft posts, schedule them, generate AI copy, and more. In this article, we will discuss the fundamentals of the Ocoya API and how you can use it to streamline your social media management.

Getting Started

To start using the Ocoya API, you must send JSON payloads in your requests and expect JSON responses. Make sure to add the following headers to every request:

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

You can use your favorite HTTP/REST library for your programming language to make HTTP calls. The base URL for all API endpoints is:

Authentication

Before using the API, you must authenticate every request with your API key. The API key is generated in the Ocoya dashboard, and you can use it to authenticate your requests. Make sure to send your API key as part of every request in an X-API-Key header. Here is an example of how to send an authenticated request using cURL:

curl --request GET
--url https://app.ocoya.com/api/_public/v1/me
--header 'X-API-Key: XXXX'

Note that API keys are designed for server-side usage, and they should not be used directly on the client-side. Also, if you lose your API key, you will have to replace it with a new one.

Endpoints

The Ocoya API has multiple endpoints that you can use to manage your social media content. You can create, read, update, and more. To send a request to an endpoint, you need to provide the required parameters (if mandatory) and send the request to the appropriate endpoint. Here is an example of how to create a post using the Ocoya API:

curl --request POST
--url https://app.ocoya.com/api/_public/v1/posts
--header 'X-API-Key: XXXX'
--header 'Content-Type: application/json'
--header 'Accept: application/json'
--data '{ "content": "Hello, world!", "schedule_time": "2022-04-19T08:00:00Z" }'

Note that every endpoint has its own set of parameters and requirements. Make sure to check the API documentation to understand the requirements of each endpoint.

Rate Limits

The Ocoya API is rate-limited to prevent abuse and ensure the stability of the platform. You can make up to 200 requests per minute. If you exceed this limit, you will receive a 429 Too Many Requests response. To avoid rate-limiting, make sure to use the API responsibly and avoid sending too many requests in a short period of time.

Extra Features

The Ocoya API also supports additional features such as language codes and AI template formats. Language codes allow you to specify the language of your content, and AI template formats allow you to generate AI copy for your posts. Note that some of these features may have limitations or require additional configuration. Make sure to check the API documentation to understand these features and their requirements.

Did this answer your question?