Getting Started
Setup Guide
Custom API Endpoint

Custom Server-Side API Endpoint

The Hardal Custom API allows you to interact with our server-side services through POST and GET requests. This document covers the usage of these requests, including required parameters and example requests.

⚠️

Important: Ensure that your API requests are properly authenticated and that you are using the correct tokens. Exposing your API token publicly or using incorrect tokens can lead to unauthorized access or failed requests. Always keep your tokens secure and confidential. If you experience issues with authentication or authorization, refer to our contact support for assistance here.

POST Endpoint

Endpoint: /pubsub

Request Format

ParameterTypeRequiredDescription
messagesMessage[]YesA list of messages to be sent
pubsub"gcp"YesPub/Sub cloud provider (e.g., AWS, GCP)

Message Type

FieldTypeDescription
valuestringThe content of the message
attributes{"key": "value"}Additional attributes related to the message
messageIdstringThe unique ID of the message
publishTimeDateTime StringThe time the message was sent (ISO 8601)

Example POST Request

curl -X POST https://s2s.yourcustomdomain.com/pubsub \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR-HARDAL-SUPER-SECRET-TOKEN" \
  -d '{    
    "messages": [
      {
        "value": "Test",
        "attributes": {
          "language": "English",
          "greeting": "formal"
        },
        "messageId": "c1d7e88a-4e35-4e8e-9a0f-8c9fbd9d1123",
        "publishTime": "2024-09-09T12:30:45.123Z"
      }
    ],
    "pubsub": "gcp"
  }'

GET

/pubsub

Query Parameters

ParameterTypeRequiredDescription
CLICK_IDstringYesThe click ID
PUBSUB"gcp"YesPub/Sub cloud provider, such as AWS, GCP, etc.
Extra ParametersstringNoAdditional query parameters are treated as attributes

Example GET Request

curl "https://s2s.yourcustomdomain.com/pubsub?CLICK_ID=112233&PUBSUB=gcp&param1=value1" \
  -H "Authorization: Bearer YOUR-HARDAL-SUPER-SECRET-TOKEN"

Custom Endpoint

The endpoint for accessing the API can be customized based on your needs. To request a custom endpoint configuration, please use the following template to specify your requirements. This will help us set up the endpoint according to your needs.

ParameterDescription
Endpoint PathSpecify the desired path for your custom endpoint (e.g., /measurement).
Request MethodIndicate whether you need a GET or POST method for this endpoint.
Query ParametersList any query parameters you require, including their names, types, and whether they are required or optional.
Request BodyDescribe the structure of the request body, including any required fields and their types.
Additional ConfigurationsInclude any additional configurations or requirements you have for this endpoint.

Example Request

Here is an example of how you might fill out the request template:

**Endpoint Path:**
/measurement
 
**Request Method:**
POST
 
**Request Body:**
```json
{
  "value": "string",
  "attributes": {
    "key": "value"
  },
  "messageId": "string",
  "publishTime": "DateTime String"
}