Giveaways

Import giveaway codes into a giveaway pool

[!note] Management API endpoints are not meant to be used in real-time integrations that directly serve your end users. Rate limit: 3 requests per second.

Upload a CSV file containing the giveaway codes that should be created. Send the file as multipart data.

The CSV file contains the following columns:

  • code (required): The code of your giveaway, for instance, a gift card redemption code.
  • startdate: The start date in RFC3339 of the code redemption period.
  • enddate: The last date in RFC3339 of the code redemption period.
  • attributes: A JSON object describing custom giveaway attribute names and their values, enclosed with double quotation marks.<br /> For example, if you created a custom attribute called provider associated with the giveaway entity, the object in the CSV file, when opened in a text editor, must be: "{"provider": "myPartnerCompany"}".

The startdate and enddate have nothing to do with the validity of the codes. They are only used by the Rule Engine to award the codes or not.

You can use the time zone setting of your choice. The values are converted to UTC internally by Talon.One.

[!note] Note

  • We recommend limiting your file size to 500MB.
  • You can import the same code multiple times. Duplicate codes are treated and distributed to customers as unique codes.

Example

code,startdate,enddate,attributes
GIVEAWAY1,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,"{""provider"":
""Amazon""}"
GIVEAWAY2,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,"{""provider"":
""Amazon""}"
GIVEAWAY3,2021-01-10T23:00:00Z,2022-11-11T23:00:00Z,"{""provider"":
""Aliexpress""}"
post/v1/giveaways/pools/{poolId}/import

Request

Path parameters

poolIdinteger required

The ID of the pool. You can find it in the Campaign Manager, in the Giveaways section.

Request body multipart/form-data

upFilestring binary

The CSV file containing the data that is being imported.

Response

OK

idinteger required

The internal ID of this entity.

createdstring date-time required

The time this entity was created.

accountIdinteger required

The ID of the account that owns this entity.

userIdinteger required

The ID of the user associated with this entity.

entitystring required

The name of the entity that was imported.

amountinteger required

The number of values that were imported.

Example response

{
  "id": 6,
  "created": "2020-06-10T09:05:27.993483Z",
  "accountId": 3886,
  "userId": 388,
  "entity": "AttributeAllowedList",
  "amount": 10
}

Changes

No recorded changes to this operation across all 2 revisions of this API.