POST api/v2/admin/tasks/account

Creates a new task for the account. Before a new task can be created a client must have been created before hand.

Request Information

URI Parameters

None.

Body Parameters

The details of the task to be created.

TwoSms.CustomerPortalRole.API.Admin.Tasks.AccountTaskRequest
NameDescriptionTypeAdditional information
TaskID

The ID of the task to be registered.

globally unique identifier

Required

Frequency

How often the task should run.

TwoSms.Platform.Database.CustomerPortal.Tables.Task.Frequency

Required

StartDate

Determines when the task should start running.

date

None.

FinishDate

Determines when the task should stop running.

date

None.

Parameters

The parameters for the task.

string

Required

ContentType

The format the parameters are in. Must either be application/xml or application/json.

string

Required

Notification

Determines the notifications the task could send back to the user.

TwoSms.Platform.Database.CustomerPortal.Tables.Task.TaskNotification

None.

Request Formats

application/json, text/json

Sample:
{
  "TaskID": "c3b3cd17-22cd-4020-874e-5822907900c6",
  "Frequency": 0,
  "StartDate": "2024-04-16T22:18:52.0665464+00:00",
  "FinishDate": "2024-04-16T22:18:52.0665464+00:00",
  "Parameters": "sample string 3",
  "ContentType": "sample string 4",
  "Notification": 0
}

application/xml, text/xml

Sample:
<AccountTaskRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <TaskID>c3b3cd17-22cd-4020-874e-5822907900c6</TaskID>
  <Frequency>NONE</Frequency>
  <StartDate>2024-04-16T22:18:52.0665464+00:00</StartDate>
  <FinishDate>2024-04-16T22:18:52.0665464+00:00</FinishDate>
  <Parameters>sample string 3</Parameters>
  <ContentType>sample string 4</ContentType>
  <Notification>NONE</Notification>
</AccountTaskRequest>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'System.Web.Http.ModelBinding.JQueryMvcFormUrlEncodedFormatter' to write type 'TwoSms.CustomerPortalRole.API.Admin.Tasks.AccountTaskRequest'.

Response Information

Resource Description

The task details with its ID field populated.

TwoSms.CustomerPortalRole.API.Misc.ResponseOfTwoSms.CustomerPortalRole.API.Admin.Tasks.AccountTaskResponse
NameDescriptionTypeAdditional information
Error

TwoSms.CustomerPortalRole.API.Misc.Error

None.

ResponseData

TwoSms.CustomerPortalRole.API.Misc.ResponseDataOfTwoSms.CustomerPortalRole.API.Admin.Tasks.AccountTaskResponse

None.

Response Formats

application/json, text/json

Sample:
{
  "Error": {
    "ErrorCode": "sample string 1",
    "ErrorReason": "sample string 2"
  },
  "ResponseData": {
    "Identification": {
      "UserId": "sample string 1"
    },
    "Result": "sample string 1",
    "Detail": {
      "ID": "b7f0ef5b-18c0-4ba9-b8a2-38c835192164",
      "TaskID": "af8c9f1d-2aad-4f0b-ad9d-dbedbd0f6c21",
      "Name": "sample string 3",
      "Enabled": true,
      "Frequency": "sample string 5",
      "StartDate": "2024-04-16T22:18:52.0742363+00:00",
      "FinishDate": "2024-04-16T22:18:52.0742363+00:00",
      "Parameters": "sample string 7",
      "ContentType": "sample string 8",
      "Notification": "sample string 9",
      "DateCreated": "2024-04-16T22:18:52.0742363+00:00",
      "DateModified": "2024-04-16T22:18:52.0742363+00:00",
      "LastRunOn": "2024-04-16T22:18:52.0742363+00:00",
      "LastRunBy": "sample string 11",
      "LastModifiedBy": "sample string 12",
      "Status": "sample string 13",
      "ClientID": "fc078d8e-b1cc-498d-80dc-c29371c882b5"
    }
  }
}