Endpoint #
GET /wp-json/rtcl/v1/my
Description #
This endpoint returns the current logged-in user’s account information.
- Provides details such as name, email, phone, address, locations, profile picture, and subscriptions (if enabled).
- Only accessible to logged-in users.
Authentication #
This endpoint requires both JWT and API Key authentication:
Request Headers #
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer <JWT_TOKEN> | Yes |
| X-API-KEY | <YOUR_API_KEY> | Yes |
Request Parameters #
This GET endpoint does not require any query parameters.
cURL Example Request #
curl -X GET "https://yourdomain.com/wp-json/rtcl/v1/my" \
-H "Authorization: Bearer <JWT_TOKEN>" \
-H "X-API-KEY: <YOUR_API_KEY>"
Success Response #
Status Code: 200 OK
{
"id": 1,
"first_name": "Demo",
"last_name": "User",
"username": "demo_user",
"email": "demo@example.com",
"phone": "0123456789",
"whatsapp_number": "0123456789",
"website": "https://example.com",
"description": "This is a demo user profile.",
"isAdmin": false,
"locations": [
{
"term_id": 1,
"name": "Demo City"
},
{
"term_id": 2,
"name": "Sample Town"
}
],
"zipcode": "12345",
"address": "123 Demo Street",
"latitude": "23.8103",
"longitude": "90.4125",
"pp_thumb_url": "https://gravatar.com/avatar/demo123?s=80&d=mm",
"membership": {
"is_expired": false,
"expired_at": "2026-12-31 23:59:59",
"remaining_ads": "10",
"posted_ads": "5",
"promotions": {
"featured": {
"ads": 5,
"validate": 10
},
"_top": {
"ads": 3,
"validate": 7
},
"_bump_up": {
"ads": 2,
"validate": 5
}
},
"free_ads": 2
},
"store": true
}
Fields Description #
| Field | Type | Description |
|---|---|---|
id | integer | User ID |
first_name | string | First name |
last_name | string | Last name |
username | string | WordPress username |
email | string | Email address |
phone | string | Phone number |
whatsapp_number | string | WhatsApp number |
website | string | Website URL |
description | string | User bio or description |
isAdmin | boolean | True if user is administrator |
locations | array | Array of location terms assigned to user |
zipcode | string | Postal code |
address | string | Address |
latitude | string | Latitude coordinate |
longitude | string | Longitude coordinate |
pp_thumb_url | string | Profile picture URL |
membership | object | Membership/subscription info |
membership.is_expired | boolean | True if membership has expired |
membership.expired_at | string | Expiration date of membership |
membership.remaining_ads | string | Number of remaining ads |
membership.posted_ads | string | Number of ads already posted |
membership.promotions | object | Promotion usage details: featured, _top, _bump_up |
membership.free_ads | integer | Number of free ads available |
store | boolean | True if user has a store |
Error Responses #
1. Not Logged In #
Status Code: 403 Forbidden
{
"status": "error",
"error": "FORBIDDEN",
"code": "403",
"error_message": "You are not logged in."
}
2. Invalid API Key #
Status Code: 401 Unauthorized
{
"status": "error",
"error": "INVALID_API_KEY",
"code": "401",
"error_message": "Sorry, you are using invalid API Key."
}
3. Missing API Key Header #
Status Code: 401 Unauthorized
{
"status": "error",
"error": "MISSING_X_API_KEY_HEADER",
"code": "401",
"error_message": "X_API_KEY header not received. Either authorization header was not sent or it was removed by your server due to security reasons."
}