post https://yourapihubdomain.io/v1/target-groups
This API is used to create a target group from SFTP location.
Know your endpoint
Based on the domain you use to log in to Webex Campaign, the endpoint domain for your API varies. For more information, refer to the Know Your API Endpoints section.
Headers
The following table describes the request headers:
Request Header | Description |
---|---|
content-type | application/json |
authorization | Access token or API Secret Key in Bearer format Example: Bearer $(key) |
Request Headers
Parameter | Description |
---|---|
name | specifies a name for the target group. |
description | Specifies a description for the target group. |
source | Specifies the target group source. The possible options are: * 1 - Sftp |
supportedChannels | Specifies the list of channels in which the target group can be used. M - Mobile E - Email * A - App |
ftpSourceInfo | Specifies the SFTP source details: ftpServerId: Specifies the server id. filePath: Specifies the file name that is available in sftp path. fileProcessMode: Specifies the file process mode. Set the value as 0 (dynamic). isSendToRemoteLocation: remoteServerId: Specifies the remote serve id. remoteServerFolder: Specifies the remote server folder. isRenameFile: Specifies if the file should be renamed. Set the value as 0. renamedFileName: Specifies a suffix for the file name. |
targetGroupType | Specifies the target group type. |
recordSkipeType | Specifies if the records to be skipped incase of error. |
thresholdType | Specifies the threshold type. |
thresholdValue | Specifies the threshold value. |
isAllowRemoteUpdate | Specifies if the remote updates are allowed for the target group. |
remoteUpdateComment | Specifies the comment when remote updates is enabled. |
targetHeadersInfo | Specifies the all the target data headers in an array. headerName: Specifies the header name. isDataEncReq: Specifies if the data encryption is required for the parameter. Set the value as 1. isMandatoryParam: Specifies if the parameter is mandatory. Set the value as 1. headerEncEdit: Specifies the header encryption to be edited. Set the value as "true": * headerValEdit: Specifies the header value to be edited. Set the value as "true": |
Request Example
{
"name": "QA_SFTP_Dynamic_TG",
"description": "SFTP",
"source": 1,
"supportedChannels": [
"M",
"E"
],
"ftpSourceInfo": {
"ftpServerId": "16351704270000",
"filePath": "API_TG_2.txt",
"fileProcessMode": 0,
"isSendToRemoteLocation": 0,
"remoteServerId": null,
"remoteServerFolder": null,
"isRenameFile": 0,
"renamedFileName": null
},
"targetGroupType": 1,
"recordSkipeType": 0,
"thresholdType": 0,
"thresholdValue": null,
"isAllowRemoteUpdate": 0,
"remoteUpdateComment": "null",
"targetHeadersInfo": [{
"headerName": "MSISDN",
"isDataEncReq": 1,
"isMandatoryParam": 1,
"headerEncEdit": true,
"headerValEdit": true
},
{
"headerName": "EMAIL",
"isDataEncReq": 1,
"isMandatoryParam": 1,
"headerEncEdit": true,
"headerValEdit": true
},
{
"headerName": "CUSTOMERID",
"isDataEncReq": 1,
"isMandatoryParam": 1,
"headerEncEdit": true,
"headerValEdit": true
}
]
}
Response Parameters
This API will return the following response parameters:
Parameter | Description |
---|---|
id | Returns the id of the target group. |
name | Returns the name of the target group. |
message | Returns a confirmation message. |
Response Example
{
"id": "16733332070001",
"name": "QA_SFTP_Dynamic_TG",
"message": "Successful Response."
}
Failure Response Codes
The API will return code within the response as per the following table in case of failure scenarios.
HTTP Status Code | Code within API Response | Description |
---|---|---|
400 | 400 | I/O error on post request. Cannot retry due to server authentication, in streaming mode. |
401 | 430 | Authorization failed. This resource is not allowed to access using this TOKEN or KEY |
401 | 498 | Invalid token or Access token expired |
404 | 404 | Not found |
405 | 405 | Method not supported |
409 | 409 | Target name already exists |
500 | 500 | Internal server error |
500 | 1001 | Invalid input JSON |