RocketCOMS

Update a Batch File

Update a previously uploaded campaign batch file with a new CSV file. For example, you may need to resolve errors with the original CSV file and then upload a corrected CSV file.

You can only update a batch file that has a status of CREATED. You cannot update a batch file that has already been processed. When creating a batch file, set ACTION to VALIDATE if you want to check the file for errors before processing the file.

The CSV file must include the following columns:

  • recipient phone number
  • message text

For example:

1237774444,New Product Launch This Month
1236663333,New Product Launch This Month

Line breaks are supported in the message with the special character \n (Line Feed). To avoid having an extra space in your message, do not put a space after \n.

For example, enter the message as:
\nHello World
not:
\n Hello World

Note  An SMS message is limited to 140 bytes, which is 160 7-bit characters. Inclusion of 8-bit characters (such as [ ] \ | ) may reduce the number of characters included in the message. For messages over 140 bytes, RocketCOMS will split the message into multiple segments. These segments are then stitched back together into a single message on the subscriber’s mobile device. Because each segment is charged as a separate SMS message, sending long messages may increase the cost to the subscriber. Note that if you’re using URL shortening, RocketCOMS uses the message length after the URLs are shortened to determine if segmentation is required.

Endpoint

PATCH /v1/batches/{id}

Authorization Header

Authorization: Bearer <access_token>
or
Authorization: Basic <encodedString>
where <encodedString> is your <api-key>:<api-secret> string encoded using Base64 encoding

Path Parameters

id  REQUIRED

string (UUID)

Unique ID assigned to the batch.

Query Parameters

externalId

string

Your organization’s internal reference number assigned to the batch. This reference number is not used by RocketCOMS.

description

string

Description of the batch.

startDate

string, format: YYYY-MM-DD

Date to start processing the batch messages. Cannot be a date in the past.

endDate

string, format: YYYY-MM-DD

Date to stop processing the batch messages. If endDate is not provided, the batch will be processed until all messages are sent.

startTime

string, format: hh:mm

Time to start processing the batch messages. Messages will only be sent during the period defined by startTime and endTime.

endTime

string, format: hh:mm

Time to stop processing the batch messages. Messages will only be sent during the period defined by startTime and endTime.

shortlink

boolean, default: false

Whether all URLs in SMS messages will be sent as short links.

action

string enum, values: VALIDATE, SCHEDULE

default: SCHEDULE

Determine how the uploaded batch file will be handled. Possible values are:

  • VALIDATE  The batch file will be checked for errors only. The file will not be processed. Use this option if you want to validate the file and resolve any errors before processing it.Use the Retrieve Batch Errors API to retrieve the error details for the batch file. After resolving any errors, use the Update Batch File API to upload an updated batch file for processing.
  • SCHEDULE  The batch file will be checked for errors and then the file will be scheduled for processing. Use the Retrieve Batch Errors API to retrieve the error details for the batch file. Note that you cannot update a batch file once it has been processed.

Request Body

file  REQUIRED

string (binary)

CSV file to upload.

Returns

Returns the batch details and status. For details, see the Batch object.

SAMPLE RESPONSE

				
					{
  "status": "0010",
  "message": "Batch created. CSV file is in progress",
  "result": {
    "id": "32df8770-ee48-46e7-a8c7-9ec478883076",
    "campaignId": "05ee2300-51cd-4021-b28d-11597cf9a175",
    "description": "Spring Sale",
    "externalId": "a7896",
    "startDate": "2022-04-25",
    "endDate": "2022-04-25",
    "startTime": "02:00:00",
    "endTime": "04:00:00",
    "status": "DELIVERED",
    "createdAt": "2022-04-24T16:51:03.419Z",
    "updatedAt": "2022-04-24T16:51:03.419Z",
    "finishedAt": "2022-04-25T04:00:03.419Z"
  }
}