POST api/2.0/crm/history This function requires authentication

Description

Creates an event with the parameters specified in the request.

Parameters
Name Description Type Example
entityType
sent in body
Related entity type
Allowed values: opportunity or case
optional
string some text
entityId
sent in body
Related entity ID
optional
number 1234
contactId
sent in body
Contact ID
optional
number 1234
content
sent in body
Event contents string some text
categoryId
sent in body
Event category ID number 1234
created
sent in body
Event creation date
optional
Date and Time Roundtrip format: 2008-04-10T06-30-00.000Z
fileId
sent in body
List of file IDs for the current event
optional
Collection of numbers
collection
1234
notifyUserList
sent in body
List of users who will be notified about the event
optional
Collection of guids
collection
9924256A-739C-462b-AF15-E652A3B1B6EB
Remark

You must set a value for 'contactId' if 'entityId' is not set, or a values for the 'entityId' and 'entityType' parameters if 'contactId' is not set.

Example
POST api/2.0/crm/history
Host: yourportal.onlyoffice.com
Content-Type: application/json
Accept: application/json

{
  "entityType": "some text",
  "entityId": 1234,
  "contactId": 1234,
  "content": "some text",
  "categoryId": 1234,
  "created": "2008-04-10T06-30-00.000Z",
  "fileId": [
    1234
  ],
  "notifyUserList": [
    "9924256A-739C-462b-AF15-E652A3B1B6EB"
  ]
}
Returns

Created event

Example Response

application/json

{
  "status": 0,
  "response": {
    "CreateBy": {
      "Id": "00000000-0000-0000-0000-000000000000",
      "DisplayName": "Mike Zanyatski",
      "Title": "Manager",
      "AvatarSmall": "url to small avatar",
      "ProfileUrl": "\\/Products\\/People\\/Profile.aspx?user=administrator"
    },
    "Created": "2020-12-13T17:13:31.5902727Z",
    "Content": "Agreed to meet at lunch and discuss the client commercial offer",
    "Category": {
      "ImagePath": "path to image",
      "id": 1234,
      "Title": "Title",
      "Description": "Description",
      "Color": "#a7fc00",
      "SortOrder": 1
    },
    "Contact": {
      "SmallFotoUrl": "url to foto",
      "MediumFotoUrl": "url to foto",
      "DisplayName": "Tadjeddine Bachir",
      "IsCompany": false,
      "AccessList": [
        {
          "Id": "00000000-0000-0000-0000-000000000000",
          "DisplayName": "Mike Zanyatski",
          "Title": "Manager",
          "AvatarSmall": "url to small avatar",
          "ProfileUrl": "\\/Products\\/People\\/Profile.aspx?user=administrator"
        }
      ],
      "IsPrivate": true,
      "IsShared": false,
      "ShareType": 0,
      "Currency": {
        "Title": "Chinese Yuan",
        "Symbol": "¥",
        "Abbreviation": "CNY",
        "CultureName": "CN",
        "IsConvertable": true,
        "IsBasic": false
      },
      "CanEdit": true,
      "CanDelete": true,
      "id": 1234
    },
    "Entity": {
      "EntityType": "opportunity",
      "EntityId": 123445,
      "EntityTitle": "Household appliances internet shop"
    },
    "CanEdit": true,
    "Files": [
      {
        "RootFolderType": 2,
        "UpdatedBy": {
          "Id": "00000000-0000-0000-0000-000000000000",
          "DisplayName": "Mike Zanyatski",
          "Title": "Manager",
          "AvatarSmall": "url to small avatar",
          "ProfileUrl": "\\/Products\\/People\\/Profile.aspx?user=administrator"
        },
        "Created": "2020-12-13T17:13:31.5902727Z",
        "CreatedBy": {
          "Id": "00000000-0000-0000-0000-000000000000",
          "DisplayName": "Mike Zanyatski",
          "Title": "Manager",
          "AvatarSmall": "url to small avatar",
          "ProfileUrl": "\\/Products\\/People\\/Profile.aspx?user=administrator"
        },
        "Updated": "2020-12-13T17:13:31.5902727Z",
        "ProviderItem": true,
        "ProviderKey": "1234d",
        "ProviderId": 1234,
        "FolderId": 12334,
        "Version": 3,
        "VersionGroup": 1,
        "ContentLength": "12.06 KB",
        "PureContentLength": 12345,
        "FileStatus": 2,
        "ViewUrl": "http:\\/\\/www.onlyoffice.com\\/viewfile?fileid=2221",
        "WebUrl": "http:\\/\\/www.onlyoffice.com\\/viewfile?fileid=2221",
        "FileType": 7,
        "FileExst": ".txt",
        "Comment": null,
        "Encrypted": true,
        "Id": 857864274,
        "Title": "Some titile.txt",
        "Access": 1,
        "Shared": false
      }
    ],
    "id": 1234
  }
}

text/xml

<result>
  <status>0</status>
  <response>
    <CreateBy>
      <Id>00000000-0000-0000-0000-000000000000</Id>
      <DisplayName>Mike Zanyatski</DisplayName>
      <Title>Manager</Title>
      <AvatarSmall>url to small avatar</AvatarSmall>
      <ProfileUrl>\/Products\/People\/Profile.aspx?user=administrator</ProfileUrl>
    </CreateBy>
    <Created>2020-12-13T17:13:31.5902727Z</Created>
    <Content>Agreed to meet at lunch and discuss the client commercial offer</Content>
    <Category>
      <ImagePath>path to image</ImagePath>
      <id>1234</id>
      <Title>Title</Title>
      <Description>Description</Description>
      <Color>#a7fc00</Color>
      <SortOrder>1</SortOrder>
    </Category>
    <Contact>
      <SmallFotoUrl>url to foto</SmallFotoUrl>
      <MediumFotoUrl>url to foto</MediumFotoUrl>
      <DisplayName>Tadjeddine Bachir</DisplayName>
      <IsCompany>False</IsCompany>
      <AccessList>
        <Id>00000000-0000-0000-0000-000000000000</Id>
        <DisplayName>Mike Zanyatski</DisplayName>
        <Title>Manager</Title>
        <AvatarSmall>url to small avatar</AvatarSmall>
        <ProfileUrl>\/Products\/People\/Profile.aspx?user=administrator</ProfileUrl>
      </AccessList>
      <IsPrivate>True</IsPrivate>
      <IsShared>False</IsShared>
      <ShareType>0</ShareType>
      <Currency>
        <Title>Chinese Yuan</Title>
        <Symbol>¥</Symbol>
        <Abbreviation>CNY</Abbreviation>
        <CultureName>CN</CultureName>
        <IsConvertable>True</IsConvertable>
        <IsBasic>False</IsBasic>
      </Currency>
      <CanEdit>True</CanEdit>
      <CanDelete>True</CanDelete>
      <id>1234</id>
    </Contact>
    <Entity>
      <EntityType>opportunity</EntityType>
      <EntityId>123445</EntityId>
      <EntityTitle>Household appliances internet shop</EntityTitle>
    </Entity>
    <CanEdit>True</CanEdit>
    <Files>
      <RootFolderType>2</RootFolderType>
      <UpdatedBy>
        <Id>00000000-0000-0000-0000-000000000000</Id>
        <DisplayName>Mike Zanyatski</DisplayName>
        <Title>Manager</Title>
        <AvatarSmall>url to small avatar</AvatarSmall>
        <ProfileUrl>\/Products\/People\/Profile.aspx?user=administrator</ProfileUrl>
      </UpdatedBy>
      <Created>2020-12-13T17:13:31.5902727Z</Created>
      <CreatedBy>
        <Id>00000000-0000-0000-0000-000000000000</Id>
        <DisplayName>Mike Zanyatski</DisplayName>
        <Title>Manager</Title>
        <AvatarSmall>url to small avatar</AvatarSmall>
        <ProfileUrl>\/Products\/People\/Profile.aspx?user=administrator</ProfileUrl>
      </CreatedBy>
      <Updated>2020-12-13T17:13:31.5902727Z</Updated>
      <ProviderItem>True</ProviderItem>
      <ProviderKey>1234d</ProviderKey>
      <ProviderId>1234</ProviderId>
      <FolderId>12334</FolderId>
      <Version>3</Version>
      <VersionGroup>1</VersionGroup>
      <ContentLength>12.06 KB</ContentLength>
      <PureContentLength>12345</PureContentLength>
      <FileStatus>2</FileStatus>
      <ViewUrl>http:\/\/www.onlyoffice.com\/viewfile?fileid=2221</ViewUrl>
      <WebUrl>http:\/\/www.onlyoffice.com\/viewfile?fileid=2221</WebUrl>
      <FileType>7</FileType>
      <FileExst>.txt</FileExst>
      <Comment />
      <Encrypted>True</Encrypted>
      <Id>857864274</Id>
      <Title>Some titile.txt</Title>
      <Access>1</Access>
      <Shared>False</Shared>
    </Files>
    <id>1234</id>
  </response>
</result>