Description
This method allows the marketer to import a list of coupon codes that are stored online in a data file. This is the preferred method to use for importing coupon codes into the platform because the codes themselves can be stored separately from the API method call, and the import process is asynchronous which is more conducive to importing large file sizes.
Arguments
Field | Description | Field Type | Required | Example |
---|---|---|---|---|
bank_id | The identification number of bank you want to insert the coupon codes into. To view the ID of any given coupon bank, log in to Empower Enterprise and navigate to Assets >> Manage Coupon Banks | number | Yes | 4 |
notification_email | A comma separated list of email addresses that will receive the notification when the import completes or fails. | string | Yes | jsmith@example.com, john_doe@example.com |
compression | Only include this element if the data file is compressed. Valid compression types are:
|
string | No | zip |
data_url | The URL of the data source containing the coupon codes to be imported. Include this element only if you are using the HTTP or HTTPS transfer protocols.
The only allowable file extensions include the following:
|
string | Conditional. Required if you are using HTTP(S) as your file transfer protocol. | https://www.example.com/couponCodes.zip |
ftp_server | The IP Address or the host name of the FTP server hosting the data file containing the coupon codes to be imported. Include this element only if you are using the FTP or sFTP transfer protocols. | string | Conditional. Required if you are using sFTP or FTP as your file transfer protocol. | ftp.example.com |
ftp_user_name | Username of the FTP site. | string | Conditional. Required if you are using sFTP or FTP as your file transfer protocol. | coupon_user |
ftp_user_pass | Password of the FTP site. | string | Conditional. Required if you are using sFTP or FTP as your file transfer protocol. | bX9berGaFd |
filename | The name of the data file on the FTP server that contains the coupon codes to be imported. The file name should also include the FTP directly path to the file if applicable.
The only allowable file extensions include the following:
|
string | Conditional. Required if you are using sFTP or FTP as your file transfer protocol. | /promo1/couponCodes.zip |
ftp_ssl | A boolean indicating whether SSL should be applied where:
|
string | No | 1 |
sftp | A boolean indicating whether the FTP is using sFTP security where:
|
string | No | 1 |
Response
Field | Description | Example |
---|---|---|
bank_id | The bank_id that was originally entered in the input parameters. | 4 |
notification_email | The email addresses that were originally entered in the input parameters. | jsmith@example.com, john_doe@example.com |
task_id | The job ID number assigned to the import task. Use the value returned in this XML element as one of the input parameters for the Utilities.getTasks API method call in order to retrieve the current status of the coupon code import job. | 92794 |
Response Codes
Response Code | Response Text | Condition |
---|---|---|
644 | Action not taken, invalid compression | The <compression%gt; element specified an invalid compression type or the one used on the data file does not match the one specified. |
645 | Action not taken, data_url or ftp_server is required | if HTTP(S) is the transfer protocol, the the fully qualified URL is missing. If FTP is the specified transfer protocol, then the host name or IP address of the FTP server is missing. |
646 | Action not taken, cannot pass both data_url and ftp_server | Both elements were included in the parameters. To eliminate ambiguity, the parameters need to include one or the other. |
647 | Action not taken, FTP user name and password is required | FTP is the specified transfer protocol and the user name and/or password is missing. |
648 | Action not taken, filename is required | FTP is the specified transfer protocol and the filename is missing. |
649 | Action not taken, invalid file type | The file extension of the data file is not supported. |
654 | Action not taken, data file was not copied | There was an error in retrieving the data file from either the web or FTP server. This error could arise for any number of reasons including invalid URL or FTP server, invalid FTP username and/or password, the host web server or FTP server are unavailable, etc.a |