POST api/Activity/CreateActivity

Creates a temporary activity. Activity is not saved to database before ActivityController.UpdateActivity(ActivityArgumentModel) is called at least once.

Exceptions

ExceptionCondition
HttpResponseException

Will throw HTTP status code 401 if we cannot logon or if your user is not allowed to perform this action.

ArgumentOutOfRangeException

If an attribute is out of range, for example if contract line specified by CombinedContractLineId does not exist

Examples

Create activity without specifying contract line will give you an activity based on the default contract line.


 //Setup the CreateActivityArgumentModel
 var arg = {
    TicketId :'7ECEB7B7-B533-492D-8321-E92D198551AF'
 };
//Make Ajax call
 $.ajax({
   url: 'https://api.infocare.com/api/Activity/CreateActivity',
   type: "POST",
   data: JSON.stringify(arg),
   contentType: "application/json;charset=utf-8"
})

Request Information

URI Parameters

None.

Body Parameters

Used to specify which contract line the activity will be based on. If contract line is not specified, we will use default contract line

CreateActivityArgumentModel
NameDescriptionTypeAdditional information
CombinedContractLineId

Gets or sets the contract line you want to use when creating the activity. If not specified you will get a standard contract line. Use ContractLineSearchController.FindContractLines(ContractLineSearchController.ContractLineSearchArgumentModel) to find valid contract lines.

string

None.

TicketId

Gets or sets the ticket id

string

None.

Culture

Gets or sets culture, if not specified we will use culture set on user.

string

None.

Request Formats

application/json, text/json

Sample:
{
  "CombinedContractLineId": "sample string 1",
  "TicketId": "sample string 2",
  "Culture": "sample string 3"
}

application/xml, text/xml

Sample:
<CreateActivityArgumentModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Rostov.Models">
  <Culture>sample string 3</Culture>
  <TicketId>sample string 2</TicketId>
  <CombinedContractLineId>sample string 1</CombinedContractLineId>
</CreateActivityArgumentModel>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'CreateActivityArgumentModel'.

Response Information

Resource Description

the newly created activity

ActivityReturnModel
NameDescriptionTypeAdditional information
CombinedActivityId

Gets or sets the combined activity id

string

None.

TransactionKey

Gets or sets the transaction key you got when getting the activity

string

None.

ActivityUpdates

Gets or sets a list of update actions.

Collection of AttributeUpdateModel

None.

AllowableActions

Sets or gets allowable actions. Note that enumeration is a bit/flag enumeration.

AllowableActivityActions

None.

CombinedContractLineId

Gets or sets the combined contract line

string

None.

CombinedPerformanceId

Gets or sets the performance id. If performance monitoring is not turned on this property will not be present or set to null

string

Json null value handling: Ignore

Response Formats

application/json, text/json

Sample:
{
  "CombinedActivityId": "sample string 1",
  "TransactionKey": "sample string 2",
  "ActivityUpdates": [
    {
      "AttributeName": "sample string 1",
      "AttributeAction": 0,
      "AttributeType": 0,
      "AttributeTransaction": "sample string 2",
      "AttributeData": {}
    },
    {
      "AttributeName": "sample string 1",
      "AttributeAction": 0,
      "AttributeType": 0,
      "AttributeTransaction": "sample string 2",
      "AttributeData": {}
    }
  ],
  "AllowableActions": 1,
  "CombinedContractLineId": "sample string 3",
  "CombinedPerformanceId": "sample string 4"
}

application/xml, text/xml

Sample:
<ActivityController.ActivityReturnModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Rostov.Controllers">
  <CombinedPerformanceId xmlns="http://schemas.datacontract.org/2004/07/Rostov.Models">sample string 4</CombinedPerformanceId>
  <ActivityUpdates xmlns:d2p1="http://schemas.datacontract.org/2004/07/Rostov.Models">
    <d2p1:AttributeUpdateModel>
      <d2p1:AttributeAction>Add</d2p1:AttributeAction>
      <d2p1:AttributeData />
      <d2p1:AttributeName>sample string 1</d2p1:AttributeName>
      <d2p1:AttributeTransaction>sample string 2</d2p1:AttributeTransaction>
      <d2p1:AttributeType>Field</d2p1:AttributeType>
    </d2p1:AttributeUpdateModel>
    <d2p1:AttributeUpdateModel>
      <d2p1:AttributeAction>Add</d2p1:AttributeAction>
      <d2p1:AttributeData />
      <d2p1:AttributeName>sample string 1</d2p1:AttributeName>
      <d2p1:AttributeTransaction>sample string 2</d2p1:AttributeTransaction>
      <d2p1:AttributeType>Field</d2p1:AttributeType>
    </d2p1:AttributeUpdateModel>
  </ActivityUpdates>
  <AllowableActions>AddComment</AllowableActions>
  <CombinedActivityId>sample string 1</CombinedActivityId>
  <CombinedContractLineId>sample string 3</CombinedContractLineId>
  <TransactionKey>sample string 2</TransactionKey>
</ActivityController.ActivityReturnModel>