Create Target Group API

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 HeaderDescription
content-typeapplication/json
authorizationAccess token or API Secret Key in Bearer format

Example: Bearer $(key)

Request Headers

ParameterDescription
namespecifies a name for the target group.
descriptionSpecifies a description for the target group.
sourceSpecifies the target group source. The possible options are:
* 1 - Sftp
supportedChannelsSpecifies the list of channels in which the target group can be used.
M - Mobile
E - Email
* A - App
ftpSourceInfoSpecifies 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.
targetGroupTypeSpecifies the target group type.
recordSkipeTypeSpecifies if the records to be skipped incase of error.
thresholdTypeSpecifies the threshold type.
thresholdValueSpecifies the threshold value.
isAllowRemoteUpdateSpecifies if the remote updates are allowed for the target group.
remoteUpdateCommentSpecifies the comment when remote updates is enabled.
targetHeadersInfoSpecifies 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:

ParameterDescription
idReturns the id of the target group.
nameReturns the name of the target group.
messageReturns 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 CodeCode within API ResponseDescription
400400I/O error on post request. Cannot retry due to server authentication, in streaming mode.
401430Authorization failed. This resource is not allowed to access using this TOKEN or KEY
401498Invalid token or Access token expired
404404Not found
405405Method not supported
409409Target name already exists
500500Internal server error
5001001Invalid input JSON
Language