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

Description

Creates an opportunity with the parameters specified in the request.

Parameters
Name Description Type Example
contactid
sent in body
Opportunity primary contact ID number 1234
members
sent in body
Opportunity participants
optional
Collection of numbers
collection
1234
title
sent in body
Opportunity title string some text
description
sent in body
Opportunity description
optional
string some text
responsibleid
sent in body
Opportunity responsible ID guid 9924256A-739C-462b-AF15-E652A3B1B6EB
bidType
sent in body
Bid type
Allowed values: FixedBid, PerHour, PerDay,PerWeek, PerMonth, PerYear
FixedBid, PerHour, PerDay, PerWeek, PerMonth, PerYear FixedBid
bidValue
sent in body
Amount of transactions
optional
decimal 1.1
bidCurrencyAbbr
sent in body
Currency (abbreviation)
Allowed values: EUR, RUB etc. You can get the whole list of available currencies by API
string some text
perPeriodValue
sent in body
Amount per period number 1234
stageid
sent in body
Stage ID number 1234
successProbability
sent in body
Opportunity success probability
optional
number 1234
actualCloseDate
sent in body
Actual opportunity closure date
optional
Date and Time Roundtrip format: 2008-04-10T06-30-00.000Z
expectedCloseDate
sent in body
Expected opportunity closure date
optional
Date and Time Roundtrip format: 2008-04-10T06-30-00.000Z
customFieldList
sent in body
Custom field list
optional
Dictionary(key:int, value:string)
collection
[{"Key": 0,"Value": "some text"}]
isPrivate
sent in body
Opportunity privacy: private or not Bool value true
accessList
sent in body
List of users with access rights to the opportunity
optional
Collection of guids
collection
9924256A-739C-462b-AF15-E652A3B1B6EB
isNotify
sent in body
Notifies users from the access list about the opportunity or not
optional
Bool value true
Example
POST api/2.0/crm/opportunity
Host: yourportal.onlyoffice.com
Content-Type: application/json
Accept: application/json

{
  "contactid": 1234,
  "members": [
    1234
  ],
  "title": "some text",
  "description": "some text",
  "responsibleid": "9924256A-739C-462b-AF15-E652A3B1B6EB",
  "bidType": "FixedBid",
  "bidValue": 1.1,
  "bidCurrencyAbbr": "some text",
  "perPeriodValue": 1234,
  "stageid": 1234,
  "successProbability": 1234,
  "actualCloseDate": "2008-04-10T06-30-00.000Z",
  "expectedCloseDate": "2008-04-10T06-30-00.000Z",
  "customFieldList": [
    {
      "Key": 0,
      "Value": "some text"
    }
  ],
  "isPrivate": true,
  "accessList": [
    "9924256A-739C-462b-AF15-E652A3B1B6EB"
  ],
  "isNotify": true
}
Returns

Opportunity

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-11T03:36:09.7011881Z",
    "Members": [
      {
        "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
      }
    ],
    "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
    },
    "Title": "Hotel catalogue",
    "Description": "description",
    "Responsible": {
      "Id": "00000000-0000-0000-0000-000000000000",
      "DisplayName": "Mike Zanyatski",
      "Title": "Manager",
      "AvatarSmall": "url to small avatar",
      "ProfileUrl": "\\/Products\\/People\\/Profile.aspx?user=administrator"
    },
    "BidType": 0,
    "BidValue": 11.0,
    "BidCurrency": {
      "Title": "Chinese Yuan",
      "Symbol": "¥",
      "Abbreviation": "CNY",
      "CultureName": "CN",
      "IsConvertable": true,
      "IsBasic": false
    },
    "PerPeriodValue": 1,
    "Stage": {
      "SuccessProbability": 20,
      "StageType": 0,
      "id": 1234,
      "Title": "Title",
      "Description": "Description",
      "Color": "#a7fc00",
      "SortOrder": 1
    },
    "SuccessProbability": 65,
    "ActualCloseDate": "2020-12-11T03:36:09.7011881Z",
    "ExpectedCloseDate": "2020-12-11T03:36:09.7011881Z",
    "IsPrivate": 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"
      }
    ],
    "CanEdit": true,
    "CustomFields": [
      {
        "EntityId": 14523423,
        "Label": "Birthdate",
        "FieldValue": "2020-12-08T17:37:04.5916406Z",
        "FieldType": 5,
        "Position": 10,
        "Mask": "",
        "id": 1234
      }
    ],
    "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-11T03:36:09.7011881Z</Created>
    <Members>
      <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>
    </Members>
    <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>
    <Title>Hotel catalogue</Title>
    <Description>description</Description>
    <Responsible>
      <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>
    </Responsible>
    <BidType>0</BidType>
    <BidValue>11</BidValue>
    <BidCurrency>
      <Title>Chinese Yuan</Title>
      <Symbol>¥</Symbol>
      <Abbreviation>CNY</Abbreviation>
      <CultureName>CN</CultureName>
      <IsConvertable>True</IsConvertable>
      <IsBasic>False</IsBasic>
    </BidCurrency>
    <PerPeriodValue>1</PerPeriodValue>
    <Stage>
      <SuccessProbability>20</SuccessProbability>
      <StageType>0</StageType>
      <id>1234</id>
      <Title>Title</Title>
      <Description>Description</Description>
      <Color>#a7fc00</Color>
      <SortOrder>1</SortOrder>
    </Stage>
    <SuccessProbability>65</SuccessProbability>
    <ActualCloseDate>2020-12-11T03:36:09.7011881Z</ActualCloseDate>
    <ExpectedCloseDate>2020-12-11T03:36:09.7011881Z</ExpectedCloseDate>
    <IsPrivate>False</IsPrivate>
    <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>
    <CanEdit>True</CanEdit>
    <CustomFields>
      <EntityId>14523423</EntityId>
      <Label>Birthdate</Label>
      <FieldValue>2020-12-08T17:37:04.5916406Z</FieldValue>
      <FieldType>5</FieldType>
      <Position>10</Position>
      <Mask />
      <id>1234</id>
    </CustomFields>
    <id>1234</id>
  </response>
</result>