GET
/
api
/
get-emojis
Get User Emojis
curl --request GET \
  --url https://onlyautomator.com/api/get-emojis \
  --header 'Authorization: <authorization>'
{
  "status": 200,
  "message": "Emojis retrieved successfully",
  "emoji": {
    "id": "uuid",
    "user_id": "uuid",
    "emoji": "string_or_json"
  }
}
Fetches the emoji configuration for the currently authenticated user from the emojis table.

Authentication

This endpoint requires authentication via bearer token representing a valid user session managed by Supabase Auth (cookies).Testing Note: Requires user session.
Retrieving JWT Token: (Refer to other endpoints for instructions)

Request

Authorization
string
required
Bearer token for authentication. Format: Bearer YOUR_JWT_TOKEN

Response

status
number
HTTP status code (e.g., 200).
message
string
A descriptive message about the result (e.g., “Emojis retrieved successfully”).
emoji
object
The emoji data object from the emojis table.

Error Codes

Status CodeDescriptionExample Message
401Invalid or missing authentication token.”Not authorized”
500Internal server error during processing.”Failed to get emojis”
500Database error during fetch.Specific DB error

Notes

  • Retrieves the emoji configuration for the authenticated user.
  • Assumes an emojis table exists.

Code Examples

// Using fetch
const getUserEmojis = async (apiToken) => {
  const response = await fetch(`https://onlyautomator.com/api/get-emojis`, {
    method: 'GET',
    headers: {
      'Authorization': `Bearer ${apiToken}`
    }
  });

  if (!response.ok) {
     const errorData = await response.json();
     throw new Error(`API Error (${response.status}): ${errorData.error || 'Unknown error'}`);
  }
  return await response.json();
};

// Example usage
getUserEmojis('your_api_token')
  .then(data => console.log('User emoji config:', data.emoji))
  .catch(error => console.error('Error fetching emoji config:', error));

Headers

Authorization
string
required

Bearer token for authentication (JWT)

Response

Emojis retrieved successfully.

status
number
Example:

200

message
string
Example:

"Emojis retrieved successfully"

emoji
object
Example:
{
"id": "uuid",
"user_id": "uuid",
"emoji": "string_or_json"
}