Static Site Endpoints
This endpoint group provides methods for interacting with static site features, such as newsletter subscriptions and contact form submissions. These endpoints are designed for public access from static frontends.
Endpoints
POST /api/rpc (Method: StaticSiteRpc.subscribe)
Description: Subscribes a user to a newsletter by saving their details.
Request Body:
{ "method": "StaticSiteRpc.subscribe", "params": { "name": "John Doe", "email": "[email protected]", "phoneNumber": "+15551234567", "whatsappConsent": true } }Parameters:
Name Type Required Description nameStringNo The name of the subscriber. emailStringYes The email address of the subscriber. Must be a valid email format. phoneNumberStringNo The phone number of the subscriber. whatsappConsentBooleanNo Indicates if the user consents to receive WhatsApp messages. Defaults to false.Response:
{ "success": true, "data": { "message": "You have been successfully subscribed!" } }Example (cURL):
curl -X POST https://api.example.com/api/rpc \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_API_KEY" \ -d '{ "method": "StaticSiteRpc.subscribe", "params": { "name": "John Doe", "email": "[email protected]", "phoneNumber": "+15551234567", "whatsappConsent": true } }'
POST /api/rpc (Method: StaticSiteRpc.submitContactForm)
Description: Handles submissions from a contact form on the static site.
Request Body:
{ "method": "StaticSiteRpc.submitContactForm", "params": { "name": "Jane Doe", "email": "[email protected]", "subject": "Inquiry about services", "message": "I would like to know more about your offerings." } }Parameters:
Name Type Required Description nameStringYes The name of the person submitting the form. emailStringYes A valid email address for contact. subjectStringYes The subject of the contact message. messageStringYes The body of the contact message. Response:
{ "success": true, "data": { "message": "Thank you for your message! We will get back to you shortly." } }Example (cURL):
curl -X POST https://api.example.com/api/rpc \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_API_KEY" \ -d '{ "method": "StaticSiteRpc.submitContactForm", "params": { "name": "Jane Doe", "email": "[email protected]", "subject": "Inquiry about services", "message": "I would like to know more about your offerings." } }'