DOCS

Last updated: 3:11 PM - December 8, 2024

Offers (Experiences)

This object represents an offer or experience, which defines the structure, validation, and distribution method for a specific event, product, or service. These experiences can be distributed to specific audiences and include rules for validation, such as supply limits, point systems, and validity periods.

ENDPOINTS
  • POST /v1/experiences
  • PATCH /v1/experiences/:id
  • GET /v1/experiences/:id
  • GET /v1/experiences
  • DELETE /v1/experiences/:id

The Experience object

Attributes

id string

Unique identifier for the experience (MongoDB ObjectID).

title string

The title or name of the experience.

tileTag string

A tag to categorize or highlight the experience (e.g., 'VIP', 'Exclusive').

description string

A detailed description of the experience or offer.

coverImage string

A URL to the cover image representing the experience.

isBurnable boolean

Indicates whether the experience is burnable (redeemable) by users.

distributionMethod string

The method used to distribute the experience (e.g., 'direct', 'random').

logicGate string

The logic gate used to validate the experience distribution (e.g., 'and', 'or').

audienceIDs array of strings

Array of audience IDs that are eligible for the experience.

validation object

Validation rules applied to the experience.

content string

Additional content or details related to the experience.

contractAddress string

The blockchain contract address associated with the experience.

chainID string

The blockchain network identifier (Chain ID) where the contract resides.

userID string

The ID of the user who created the experience.

projectID string

The ID of the project under which the experience falls.

orgID string

The ID of the organization to which the experience belongs.

status string

The current status of the experience (e.g., 'active', 'inactive').

metadata map

Additional metadata for the experience. Can contain key-value pairs for extra information.

created int64

Timestamp when the experience was created (Unix timestamp).

updated_at int64

Timestamp when the experience was last updated (Unix timestamp).

v integer

Version number of the experience, typically used for concurrency control.

The Experience object
                    {
  "id": "890e8f60d3ff66832b0124f9",
  "title": "VIP Concert Tickets",
  "tileTag": "VIP",
  "description": "Exclusive VIP access to a concert event.",
  "coverImage": "https://example.com/vip-concert.png",
  "isBurnable": true,
  "distributionMethod": "direct",
  "logicGate": "and",
  "audienceIDs": [
    "audience1",
    "audience2"
  ],
  "validation": {
    "isActive": true,
    "isSupplyLimit": true,
    "isMaxPer": true,
    "points": 100,
    "maxSupply": 500,
    "maxPer": 2,
    "validStart": 1729006624,
    "validEnd": 1729611424,
  },
  "content": "Enjoy a VIP experience with front row seats and backstage access.",
  "contractAddress": "0x1234567890abcdef",
  "chainID": "1",
  "userID": "user123",
  "projectID": "project456",
  "orgID": "org789",
  "status": "active",
  "metadata": {
  },
  "created": 1729006624,
  "updated_at": 1729006724,
  "v": 1,
}
                

Create an Experience

This endpoint is used to create a new experience. The experience represents an event, offer, or interaction defined by metadata and additional parameters.

Required Parameters

userID string

The ID of the user creating the experience.

action string

Action to be performed, set to 'create' to create a new experience.

X-API-Key string

API key for authenticating the request.

Optional Parameters

metadata object

Additional metadata related to the experience. This can be customized to store relevant data.

POST /v1/experiences/create
curl -L 'https://api.gowithpush.com/experiences/create'   -H 'userID: {{userID}}'   -H 'Content-Type: application/json'   -H 'X-API-Key: <YOUR-API-KEY>'   -d '{
    "action": "create",
    "metadata": { }
  }'

RESPONSE

{
    "id": "66e29430f5cc66995a0114d7",
    "userID": "{{userID}}",
    "action": "create",
    "status": "created",
    "metadata": {},
    "created": 1729006624,
    "message": "Experience created successfully."
  }

List Experiences

This endpoint retrieves a paginated list of experiences.

Required Parameters

page integer

The page number of the paginated results.

per_page integer

The number of results per page.

userID string

The ID of the user requesting the experiences.

X-API-Key string

API key for authenticating the request.

Optional Parameters

GET /v1/experiences
curl -L 'https://api.gowithpush.com/experiences?page=1&per_page=20'   -H 'userID: 66ddfb562e0f9e66dfb56772'   -H 'X-API-Key: <YOUR-API-KEY>'

RESPONSE

{
    "experiences": [
      {
        "id": "66e29430f5cc66995a0114d7",
        "title": "Exclusive Event",
        "description": "An exclusive event for VIP members.",
        "status": "active",
        "created": 1729006624,
        "updated_at": 1729006724
      },
      {
        "id": "66e29430f5cc66995a0114d8",
        "title": "Holiday Offer",
        "description": "Special discounts for the holiday season.",
        "status": "inactive",
        "created": 1729006724,
        "updated_at": 1729006824
      }
    ],
    "page": 1,
    "per_page": 20,
    "total": 2
  }

Delete a Customer

This endpoint deletes a customer by their unique ID.

Required Parameters

id string

The unique ID of the customer to be deleted.

userID string

The ID of the user making the delete request.

X-API-Key string

API key for authenticating the request.

Optional Parameters

DELETE /v1/customers/delete
curl -L -X DELETE 'https://api.gowithpush.com/customers/delete?id=66c44ae20f74a7c33ec6a45f'   -H 'userID: 66abe34930ac8b1edfd40a96'   -H 'X-API-Key: <YOUR-API-KEY>'

RESPONSE

{
    "status": "success",
    "message": "Customer deleted successfully.",
    "customerID": "66c44ae20f74a7c33ec6a45f"
  }