POST api/Activity/ChangeContract

Change the contract on a given activity. You need to specify the activity number but all the other fields are optional which means they will only be considered if specified. If it is not possible to change the contract with the provided parameters an exception will be thrown with the reason explaining why the change is not possible.

Exceptions

ExceptionCondition
UnauthorizedHttpResponseException

If ticket cannot be validated or if you do not have access to activity

ArgumentNullHttpResponseException

If any arguments are null

ArgumentOutOfRangeHttpResponseException

If any arguments out for range

Examples

The sample below show how to setup a call the ChangeCustomer




 var arg = {
     TicketId : "71137607-4587-44C9-BE92-A699180E42C9",
     CombinedActivityId : "sesam10:1234567",
     CombinedContractLineId: "sesam10:contract_xyz:1",
     ServiceCode:            "C200",
     ResponseCode:           "RO068",
     SiteCustomerId1:        33269,
     SiteCustomerId2:        0,
     InvoiceCustomerId1:     40000,
     InvoiceCustomerId2:     0,           
 }
 $.ajax({
     url: 'https://api.infocare.com/api/Activity/ChangeContract',
     type: "POST",
     data: JSON.stringify(arg),
     contentType: "application/json;charset=utf-8"
 })
 .done(function (result) {
     // you should now iterate through ActivityUpdates to get all values, but
     // we just print returned activity number to the console
     console.log("got activity, id: " + result.CombinedActivityId);
 })
 .fail(function (jqXHR, textStatus, err) {
     console.log("getting activity failed: " + err);
 })
 

Request Information

URI Parameters

None.

Body Parameters

Identifies the activity to retrieve, specify the ActivityChangeContractModel.CombinedActivityId property

ActivityChangeContractModel
NameDescriptionTypeAdditional information
CombinedActivityId

Gets or sets combined activity id

string

None.

CombinedContractLineId

Gets or sets the Combined Contract Line Identifier. This identifier should a string of the form "database:contractid:line number". If this identifier is not provided it will be assumed that the contract to be changed is the activity current contract.

string

None.

ServiceCode

Gets or sets the the service code

string

None.

ResponseCode

Gets or sets the response code.

string

None.

SiteCustomerId1

Gets or sets the main site customer identifier.

integer

None.

SiteCustomerId2

Gets or sets the secondary site customer identifier.

integer

None.

InvoiceCustomerId1

Gets or sets the main invoice customer identifier.

integer

None.

InvoiceCustomerId2

Gets or sets the secondary invoice customer identifier.

integer

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:
{
  "CombinedActivityId": "sample string 1",
  "CombinedContractLineId": "sample string 2",
  "ServiceCode": "sample string 3",
  "ResponseCode": "sample string 4",
  "SiteCustomerId1": 1,
  "SiteCustomerId2": 1,
  "InvoiceCustomerId1": 1,
  "InvoiceCustomerId2": 1,
  "TicketId": "sample string 5",
  "Culture": "sample string 6"
}

application/xml, text/xml

Sample:
<ActivityChangeContractModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Rostov.Models">
  <Culture>sample string 6</Culture>
  <TicketId>sample string 5</TicketId>
  <CombinedActivityId>sample string 1</CombinedActivityId>
  <CombinedContractLineId>sample string 2</CombinedContractLineId>
  <InvoiceCustomerId1>1</InvoiceCustomerId1>
  <InvoiceCustomerId2>1</InvoiceCustomerId2>
  <ResponseCode>sample string 4</ResponseCode>
  <ServiceCode>sample string 3</ServiceCode>
  <SiteCustomerId1>1</SiteCustomerId1>
  <SiteCustomerId2>1</SiteCustomerId2>
</ActivityChangeContractModel>

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 'ActivityChangeContractModel'.

Response Information

Resource Description

Returns additional updates that you updates may have caused.

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>