POST api/Village/{village}/Task

Create a new task

Request Information

URI Parameters

NameDescriptionTypeAdditional information
village

Village ID

globally unique identifier

Required

Body Parameters

CreateTaskModel
NameDescriptionTypeAdditional information
Reminder

If specified, the date and time by which the task is due

date

None.

AssignedTo

List of User IDs the activity should be assigned to

Collection of globally unique identifier

None.

Tags

List of tags for the activity

Collection of string

None.

TimeZone

Time Zone for the Event/Reminder

string

None.

Title

Short title for the activity

string

Required

String length: inclusive between 0 and 255

Request Formats

application/json, text/json

Sample:
{
  "Reminder": "2025-06-03T04:19:12.091+00:00",
  "AssignedTo": [
    "76027549-f11a-4f64-9645-369a2ba5201c",
    "e6cede67-21be-4b4c-9bd3-28db0cf145bb"
  ],
  "Tags": [
    "sample string 1",
    "sample string 2"
  ],
  "TimeZone": "sample string 1",
  "Title": "sample string 2"
}

application/xml, text/xml

Sample:
<CreateTaskModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CaringVillage.Shared.Implementation.Models">
  <Title>sample string 2</Title>
  <AssignedTo xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:guid>76027549-f11a-4f64-9645-369a2ba5201c</d2p1:guid>
    <d2p1:guid>e6cede67-21be-4b4c-9bd3-28db0cf145bb</d2p1:guid>
  </AssignedTo>
  <Tags xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>sample string 1</d2p1:string>
    <d2p1:string>sample string 2</d2p1:string>
  </Tags>
  <TimeZone>sample string 1</TimeZone>
  <Reminder>2025-06-03T04:19:12.0917935+00:00</Reminder>
</CreateTaskModel>

multipart/form-data

Sample:

Failed to generate the sample for media type 'multipart/form-data'. Cannot use formatter 'MultipartMediaTypeFormatter' to write type 'CreateTaskModel'.

Response Information

Resource Description

The newly created task's ID

ViewTaskModel
NameDescriptionTypeAdditional information
Location

Obsolete

string

None.

DueDate

Obsolete

date

None.

Description

Obsolete

string

None.

Priority

Obsolete

boolean

None.

Reminder

If specified, the date and time by which the task is due

date

None.

TimeZone

Reminder time zone

string

None.

Completed

If set, the Date/Time at which the task was marked as completed

date

None.

CompletedById

For completed tasks, the ID of the user who completed the task

globally unique identifier

None.

CompletedBy

For completed tasks, the name of the user who completed the task

string

None.

ActivityId

Activity's unique ID

globally unique identifier

None.

CreatedById

ID of the user who created the activity

globally unique identifier

None.

CreatedBy

Name of the user who created the activity

string

None.

Created

Date/Time when the activity was created

date

None.

AssignedTo

List of users the activity is assigned to

Collection of ActivityAssignmentModel

None.

Tags

List of tags for the activity

Collection of string

None.

Attachments

File attachments

Collection of AttachmentModel

None.

History

Activity activity history

Collection of ActivityHistoryModel

None.

CommentCount

Number of entries in History which are comments

integer

None.

VillageId

The ID of the village in which this activity belongs

globally unique identifier

None.

LastUpdated

The date/time this activity was last updated; useful for handling push notifications

date

None.

Cancelled

True for activities that have been cancelled. Default value is false

boolean

None.

Title

Short title for the activity

string

Required

String length: inclusive between 0 and 255

Response Formats

application/json, text/json

Sample:
{
  "Location": "sample string 1",
  "DueDate": "2025-06-03T04:19:12.121+00:00",
  "Description": "sample string 2",
  "Priority": true,
  "Reminder": "2025-06-03T04:19:12.121+00:00",
  "TimeZone": "sample string 4",
  "Completed": "2025-06-03T04:19:12.121+00:00",
  "CompletedById": "7d32ea9f-fdc3-4208-bfcb-df43bb0506fc",
  "CompletedBy": "sample string 5",
  "ActivityId": "ee981522-496a-4bfa-bce7-574a9b6515cf",
  "CreatedById": "0e774e46-496c-4a2f-adb2-17ee134d4e6b",
  "CreatedBy": "sample string 8",
  "Created": "2025-06-03T04:19:12.121+00:00",
  "AssignedTo": [
    {
      "UserId": "ac62b198-4a12-4ae2-b8bd-74b427dc5e11",
      "Name": "sample string 2"
    },
    {
      "UserId": "ac62b198-4a12-4ae2-b8bd-74b427dc5e11",
      "Name": "sample string 2"
    }
  ],
  "Tags": [
    "sample string 1",
    "sample string 2"
  ],
  "Attachments": [
    {
      "Id": "125a98ad-d7d9-4343-8254-a40e46a51d32",
      "Size": 2,
      "FileName": "sample string 3",
      "ContentType": "sample string 4",
      "UploadedBy": "sample string 5"
    },
    {
      "Id": "125a98ad-d7d9-4343-8254-a40e46a51d32",
      "Size": 2,
      "FileName": "sample string 3",
      "ContentType": "sample string 4",
      "UploadedBy": "sample string 5"
    }
  ],
  "History": [
    {
      "HistoryId": "b017abe6-f8f0-41a1-ab43-618bc6ce0cdd",
      "ActivityId": "034ee9b2-66f6-432f-8f42-9e3fab89700f",
      "PerformedById": "69a69cd5-e90e-4b7a-ae56-ef7aba21310f",
      "PerformedBy": "sample string 4",
      "AssignedToId": "6bbb7c7a-a90e-4732-b942-a463e3a342df",
      "AssignedTo": "sample string 5",
      "Action": "Comment",
      "DateTime": "2025-06-03T04:19:12.121+00:00",
      "Comments": "sample string 7",
      "Updated": "2025-06-03T04:19:12.121+00:00",
      "UpdatedById": "d1fe1656-aaa3-49ca-8bb7-d1a88816cf94",
      "UpdatedBy": "sample string 10"
    },
    {
      "HistoryId": "b017abe6-f8f0-41a1-ab43-618bc6ce0cdd",
      "ActivityId": "034ee9b2-66f6-432f-8f42-9e3fab89700f",
      "PerformedById": "69a69cd5-e90e-4b7a-ae56-ef7aba21310f",
      "PerformedBy": "sample string 4",
      "AssignedToId": "6bbb7c7a-a90e-4732-b942-a463e3a342df",
      "AssignedTo": "sample string 5",
      "Action": "Comment",
      "DateTime": "2025-06-03T04:19:12.121+00:00",
      "Comments": "sample string 7",
      "Updated": "2025-06-03T04:19:12.121+00:00",
      "UpdatedById": "d1fe1656-aaa3-49ca-8bb7-d1a88816cf94",
      "UpdatedBy": "sample string 10"
    }
  ],
  "CommentCount": 2,
  "VillageId": "a61733ad-24a2-4b86-b48a-f72370537439",
  "LastUpdated": "2025-06-03T04:19:12.121+00:00",
  "Cancelled": true,
  "Title": "sample string 13"
}

application/xml, text/xml

Sample:
<ViewTaskModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CaringVillage.Shared.Implementation.Models">
  <Title>sample string 13</Title>
  <ActivityId>ee981522-496a-4bfa-bce7-574a9b6515cf</ActivityId>
  <AssignedTo>
    <ActivityAssignmentModel>
      <Name>sample string 2</Name>
      <UserId>ac62b198-4a12-4ae2-b8bd-74b427dc5e11</UserId>
    </ActivityAssignmentModel>
    <ActivityAssignmentModel>
      <Name>sample string 2</Name>
      <UserId>ac62b198-4a12-4ae2-b8bd-74b427dc5e11</UserId>
    </ActivityAssignmentModel>
  </AssignedTo>
  <Attachments>
    <AttachmentModel>
      <ContentType>sample string 4</ContentType>
      <FileName>sample string 3</FileName>
      <Id>125a98ad-d7d9-4343-8254-a40e46a51d32</Id>
      <Size>2</Size>
      <UploadedBy>sample string 5</UploadedBy>
    </AttachmentModel>
    <AttachmentModel>
      <ContentType>sample string 4</ContentType>
      <FileName>sample string 3</FileName>
      <Id>125a98ad-d7d9-4343-8254-a40e46a51d32</Id>
      <Size>2</Size>
      <UploadedBy>sample string 5</UploadedBy>
    </AttachmentModel>
  </Attachments>
  <Cancelled>true</Cancelled>
  <Created>2025-06-03T04:19:12.1219704+00:00</Created>
  <CreatedBy>sample string 8</CreatedBy>
  <CreatedById>0e774e46-496c-4a2f-adb2-17ee134d4e6b</CreatedById>
  <History>
    <ActivityHistoryModel>
      <ActivityId>034ee9b2-66f6-432f-8f42-9e3fab89700f</ActivityId>
      <AssignedTo>sample string 5</AssignedTo>
      <AssignedToId>6bbb7c7a-a90e-4732-b942-a463e3a342df</AssignedToId>
      <Comments>sample string 7</Comments>
      <DateTime>2025-06-03T04:19:12.1219704+00:00</DateTime>
      <HistoryId>b017abe6-f8f0-41a1-ab43-618bc6ce0cdd</HistoryId>
      <PerformedBy>sample string 4</PerformedBy>
      <PerformedById>69a69cd5-e90e-4b7a-ae56-ef7aba21310f</PerformedById>
      <Updated>2025-06-03T04:19:12.1219704+00:00</Updated>
      <UpdatedBy>sample string 10</UpdatedBy>
      <UpdatedById>d1fe1656-aaa3-49ca-8bb7-d1a88816cf94</UpdatedById>
    </ActivityHistoryModel>
    <ActivityHistoryModel>
      <ActivityId>034ee9b2-66f6-432f-8f42-9e3fab89700f</ActivityId>
      <AssignedTo>sample string 5</AssignedTo>
      <AssignedToId>6bbb7c7a-a90e-4732-b942-a463e3a342df</AssignedToId>
      <Comments>sample string 7</Comments>
      <DateTime>2025-06-03T04:19:12.1219704+00:00</DateTime>
      <HistoryId>b017abe6-f8f0-41a1-ab43-618bc6ce0cdd</HistoryId>
      <PerformedBy>sample string 4</PerformedBy>
      <PerformedById>69a69cd5-e90e-4b7a-ae56-ef7aba21310f</PerformedById>
      <Updated>2025-06-03T04:19:12.1219704+00:00</Updated>
      <UpdatedBy>sample string 10</UpdatedBy>
      <UpdatedById>d1fe1656-aaa3-49ca-8bb7-d1a88816cf94</UpdatedById>
    </ActivityHistoryModel>
  </History>
  <LastUpdated>2025-06-03T04:19:12.1219704+00:00</LastUpdated>
  <Tags xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>sample string 1</d2p1:string>
    <d2p1:string>sample string 2</d2p1:string>
  </Tags>
  <VillageId>a61733ad-24a2-4b86-b48a-f72370537439</VillageId>
  <Completed>2025-06-03T04:19:12.1219704+00:00</Completed>
  <CompletedBy>sample string 5</CompletedBy>
  <CompletedById>7d32ea9f-fdc3-4208-bfcb-df43bb0506fc</CompletedById>
  <Description>sample string 2</Description>
  <DueDate>2025-06-03T04:19:12.1219704+00:00</DueDate>
  <Location>sample string 1</Location>
  <Priority>true</Priority>
  <Reminder>2025-06-03T04:19:12.1219704+00:00</Reminder>
  <TimeZone>sample string 4</TimeZone>
</ViewTaskModel>