3. Get Signups

Signups API Endpoint Documentation

This documentation provides details on the GET endpoint for fetching signups based on various filters.

Endpoint

https://brands.gotoaisle.com/api/v1/[brandId]/customers/signups

Method

GET

Parameters

Path Parameters:

  • brandId: ID of the brand you want to fetch signups for. This should be provided in the URL as https://brands.gotoaisle.com/api/v1/[brandId]/customers/signups.

Query Parameters:

  • startDate (optional): The start date to filter the signups by createdAt property which is the signup date. The expected format is YYYY-MM-DD.
  • endDate (optional): The end date to filter the signups by createdAt property which is the signup date. The expected format is YYYY-MM-DD. If startDate is provided, endDate must also be provided.
  • limit (optional): Limit the number of records returned. Defaults to 100 if not provided. Max value is 250.
  • nextPageToken (optional): If you have more records than the limit, you can use the token provided in the previous response to fetch the next set of records.

Responses

Success Response:

{
  "recordsCount": number,
  "signups": [
    {
      // signups details
    },
    ...
  ],
  "nextPageToken": "encodedToken" // provided if there are more records to fetch
}

Error Response:

{
  "error": "Error message detailing what went wrong."
}

Example

Fetching signups for brand with ID 1234:

GET https://brands.gotoaisle.com/api/v1/1234/customers/signups?startDate=2023-01-01&endDate=2023-01-31&limit=50

Successful Response

{
  "signups": [
    {
      "id": "signup001",
      "phoneNumberLast4": "7890",
      "email": "alice@example.com",
      "createdAt": "2023-09-18T10:00:00.000Z",
      "referrerUrl": "https://example.com/referrer1",
      "utmSource": "google",
      "utmCampaign": "promotionSept",
      "utmMedium": "cpc",
      "code": "ABCD1234",
      "campaign": {
        "id": "campaign001",
        "name": "Autumn Sale"
      }
    },
    {
      "id": "signup002",
      "phoneNumberLast4": "5678",
      "email": null,
      "createdAt": "2023-09-15T08:30:00.000Z",
      "referrerUrl": null,
      "utmSource": "facebook",
      "utmCampaign": null,
      "utmMedium": "organic",
      "code": null,
      "campaign": {
        "id": "campaign002",
        "name": "Back to School"
      }
    }
  ],
  "recordsCount": 2
}

Response Model

export type SignupRecord = {
  id: string;
  phoneNumberLast4: string;
  email: string | null;
  createdAt: Date;
  referrerUrl: string | null;
  utmSource: string | null;
  utmCampaign: string | null;
  utmMedium: string | null;
  code: string | null;
  campaign: {
    id: string;
    name: string;
  };
};
 
export interface GetSignupsResponse {
  signups: SignupRecord[];
  recordsCount: number;
  nextPageToken?: string;
}

Notes

  • Always ensure the date format for startDate and endDate is YYYY-MM-DD.
  • If you provide a startDate, you must also provide an endDate.

For further details or issues, contact our developer support.