POST api/Activity/ChangeCustomer

Change the customer on a given activity. You need to specify the customer and the customer role you want the customer to have on the activity.

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",
     CustomerNumber1:     40000,
     CustomerNumber2:     1,
     Role:                3,             
 }
 $.ajax({
     url: 'https://api.infocare.com/api/Activity/ChangeCustomer',
     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 ActivityChangeCustomerModel.CombinedActivityId property

ActivityChangeCustomerModel
NameDescriptionTypeAdditional information
CombinedActivityId

Gets or sets combined activity id

string

None.

CustomerNumber1

Gets or sets the main customer number identifier

integer

None.

CustomerNumber2

Gets or sets the secondary customer number identifier

integer

None.

Role

Gets or sets the customer role. Only the following values are allowed: 1 (SiteCustomer), 2 (SesamCompatibleInvoice) and 512 (OrderBy)

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",
  "CustomerNumber1": 2,
  "CustomerNumber2": 3,
  "Role": 4,
  "TicketId": "sample string 5",
  "Culture": "sample string 6"
}

application/xml, text/xml

Sample:
<ActivityChangeCustomerModel 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>
  <CustomerNumber1>2</CustomerNumber1>
  <CustomerNumber2>3</CustomerNumber2>
  <Role>4</Role>
</ActivityChangeCustomerModel>

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

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>