Ayocer Developer Platform API

Version v1 - Comprehensive API for building applications on the Ayocer platform

Authentication

All API requests require authentication using an API key. Include your API key in the request header:

Authorization: Bearer YOUR_API_KEY

Or alternatively:

X-API-Key: YOUR_API_KEY

Rate Limits

Rate limits are applied based on your developer account tier:

Free Tier

100/hour
1000/day
10000/month

Starter Tier

500/hour
5000/day
50000/month

Premium Tier

2000/hour
20000/day
200000/month

Apex Tier

10000/hour
100000/day
1000000/month

Authentication

Endpoints for developer authentication and account management

POST /developer/api/v1/developer/register

Register Developer Account - Create a new developer account

Parameters:

name (required) - string
Developer name
email (required) - string
Developer email
password (required) - string
Developer password
company (optional) - string
Company name

Response:

{ "status": { "code": 201, "msg": "Developer account created successfully" }, "data": { "id": "Developer ID", "name": "Developer name", "email": "Developer email", "tier": "Account tier (free, starter, premium, apex)" } }

POST /developer/api/v1/developer/login

Login Developer - Authenticate developer account

Parameters:

email (required) - string
Developer email
password (required) - string
Developer password

Response:

{ "status": { "code": 200, "msg": "Login successful" }, "data": { "developer": "Developer account information", "session_token": "Session token for authenticated requests" } }

App Management

Endpoints for managing developer applications

POST /developer/api/v1/app/create

Create App - Create a new developer application

Authentication: Required

Parameters:

name (required) - string
App name
description (required) - string
App description
website (optional) - string
App website URL
callback_url (optional) - string
OAuth callback URL
app_type (required) - string
App type (web, mobile, desktop)

Response:

{ "status": { "code": 201, "msg": "App created successfully" }, "data": { "id": "App ID", "name": "App name", "slug": "App slug", "api_keys": "Generated API keys" } }

GET /developer/api/v1/app/list

List Apps - Get list of developer applications

Authentication: Required

Parameters:

page (optional) - integer
Page number
per_page (optional) - integer
Items per page
status (optional) - string
Filter by status

Response:

{ "status": { "code": 200, "msg": "Apps retrieved successfully" }, "data": { "apps": "Array of app objects", "pagination": "Pagination information" } }

PUT /developer/api/v1/app/update

Update App - Update an existing developer application

Authentication: Required

Parameters:

id (required) - integer
App ID
name (optional) - string
App name
description (optional) - string
App description
website (optional) - string
App website URL
callback_url (optional) - string
OAuth callback URL

Response:

{ "status": { "code": 200, "msg": "App updated successfully" }, "data": "Updated app object" }

DELETE /developer/api/v1/app/delete

Delete App - Delete a developer application

Authentication: Required

Parameters:

id (required) - integer
App ID

Response:

{ "status": { "code": 200, "msg": "App deleted successfully" }, "data": null }

User Management

Endpoints for user data and management

GET /api/v1/user/profile

Get User Profile - Get user profile information

Authentication: Required

Parameters:

user_id (required) - integer
User ID

Response:

{ "status": { "code": 200, "msg": "User profile retrieved successfully" }, "data": { "id": "User ID", "name": "User name", "email": "User email", "profile_photo": "Profile photo URL", "created_at": "Account creation date" } }

GET /api/v1/user/posts

Get User Posts - Get posts by a specific user

Authentication: Required

Parameters:

user_id (required) - integer
User ID
page (optional) - integer
Page number
per_page (optional) - integer
Items per page

Response:

{ "status": { "code": 200, "msg": "User posts retrieved successfully" }, "data": { "posts": "Array of post objects", "pagination": "Pagination information" } }

Post Management

Endpoints for post creation and management

POST /api/v1/post/create

Create Post - Create a new post

Authentication: Required

Parameters:

content (required) - string
Post content
visibility (optional) - string
Post visibility (public, private, friends)
media (optional) - array
Array of media file IDs

Response:

{ "status": { "code": 201, "msg": "Post created successfully" }, "data": { "id": "Post ID", "content": "Post content", "author": "Author information", "created_at": "Creation timestamp" } }

GET /api/v1/post/list

List Posts - Get list of posts

Authentication: Required

Parameters:

page (optional) - integer
Page number
per_page (optional) - integer
Items per page
author_id (optional) - integer
Filter by author ID

Response:

{ "status": { "code": 200, "msg": "Posts retrieved successfully" }, "data": { "posts": "Array of post objects", "pagination": "Pagination information" } }

Messaging

Endpoints for messaging functionality

POST /api/v1/message/send

Send Message - Send a message to a user

Authentication: Required

Parameters:

receiver_id (required) - integer
Receiver user ID
message (required) - string
Message content
message_type (optional) - string
Message type (text, image, file)

Response:

{ "status": { "code": 201, "msg": "Message sent successfully" }, "data": { "id": "Message ID", "sender": "Sender information", "receiver": "Receiver information", "message": "Message content", "created_at": "Creation timestamp" } }

GET /api/v1/message/conversation

Get Conversation - Get conversation between two users

Authentication: Required

Parameters:

user_id (required) - integer
Other user ID
page (optional) - integer
Page number
per_page (optional) - integer
Items per page

Response:

{ "status": { "code": 200, "msg": "Conversation retrieved successfully" }, "data": { "messages": "Array of message objects", "pagination": "Pagination information" } }

Code Examples

cURL Examples

Create a new post

curl -X POST https://api.ayocer.com/api/v1/post/create \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"content": "Hello, world!", "visibility": "public"}'

Get user profile

curl -X GET https://api.ayocer.com/api/v1/user/profile?user_id=123 \ -H "Authorization: Bearer YOUR_API_KEY"

JavaScript Examples

Create a new post

const response = await fetch('https://api.ayocer.com/api/v1/post/create', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ content: 'Hello, world!', visibility: 'public' }) }); const data = await response.json(); console.log(data);

Python Examples

Create a new post

import requests url = 'https://api.ayocer.com/api/v1/post/create' headers = { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' } data = { 'content': 'Hello, world!', 'visibility': 'public' } response = requests.post(url, headers=headers, json=data) print(response.json())