API
There is a single endpoint with the following URL. It is a public endpoint, so that you can send client requests directly from your user's browser.
Endpoint
Please send a POST
request to the following public endpoint.
https://app.priceers.com/api/client
Inputs
Below are the x-www-form-urlencoded
body parameters for the API endpoint.
appId
Identifies the application for which the campaigns will be checked for.
- required:
true
- type:
string
- format:
cuid
overrideSecret
Every application has a specific overrideSecret
that you can change on your Dashboard Settings (opens in a new tab). It is like an admin secret to get access to any campaign linked to your application.
- required:
false
- type:
string
overrideCampaignId
Along with the overrideSecret
, this variable is used to get a specific campaign(s) linked to your application.
- required:
false
- type:
string
- format:
cuid
overrideDate
Overrides the date used to search the campaigns. It is ignored if it is sent along with overrideCampaignId
.
- required:
false
- type:
string
- format:
ISO 8601
Output
Please find response type below:
import type { ZodError } from "zod";
type campaignType = {
name: string;
active: boolean;
dateStart: Date;
dateEnd: Date;
color: string;
discount: number | null;
couponCode: string;
image: string;
CustomField: {
value: string;
name: string;
}[];
};
type ResponseErrorType = {
error: string | ZodError;
};
type ResponseSuccessType = {
data: {
type: "active" | "override";
campaign: campaignType | null;
};
};
type ResponseType = ResponseErrorType | ResponseSuccessType;
Formats
CUID
CUID stands for "Collision-resistant Unique IDentifier". It is a method for generating unique identifiers that are highly unlikely to collide with other identifiers generated by the same or other systems.
CUIDs are similar to UUIDs (Universally Unique IDentifiers), which are widely used in computer systems to generate unique identifiers. However, CUIDs are designed to be more compact and URL-friendly, making them more suitable for use in web applications.
A typical CUID consists of a lowercase "c" followed by a string of 25 characters, composed of letters (excluding vowels) and numbers. The string is generated using a combination of the current timestamp, a random number, and the hostname of the system generating the CUID. This ensures that each CUID is unique, even when generated simultaneously on multiple systems.
CUIDs are often used in web applications as unique identifiers for resources such as users, sessions, and transactions. They are also used in logging and debugging to track the flow of requests and responses through a system.
Example: clggmucdy000a9oca6zt48cpw
ISO 8601
ISO 8601 is an international standard that defines a format for representing date and time information in a machine-readable format. The format is widely used in computer systems and across the internet, and is designed to be unambiguous and easy to parse.
The ISO 8601 format for date and time information is as follows: YYYY-MM-DDTHH:MM:SSZ, where:
- YYYY represents the year (four digits)
- MM represents the month (two digits, 01-12)
- DD represents the day (two digits, 01-31)
- T is a separator indicating the start of the time component
- HH represents the hour (two digits, 00-23)
- MM represents the minute (two digits, 00-59)
- SS represents the second (two digits, 00-59)
- Z is a separator indicating that the time is in UTC (Coordinated Universal Time)
For example, the ISO 8601 format for April 14th, 2023, at 3:30 PM UTC would be: 2023-04-14T15:30:00Z.
ISO 8601 also allows for the representation of time zones, durations, and recurring time intervals, among other things. Overall, the standard is a useful way to represent date and time information in a consistent and machine-readable format.