POST v1/opportunities/search

Search for opportunities using the search filters.

Request Information

URI Parameters

None.

Body Parameters

OpportunitySearchParameters
NameDescriptionTypeAdditional information
Title

string

None.

StageId

integer

None.

OpportunityTypeId

integer

None.

LastUpdatedDateRange

The date and time (in company time zone) when the opportunity was last updated.

DateRange

None.

PageIndex

zero-based page number

integer

None.

PageSize

Default value is 100

integer

Range: inclusive between 1 and 1000

SortExpression

Specify the field name to sort the result set by. It can be one of the fields returned by the search.

string

None.

SortOrder

Specify Sort Order. Ascending=1, Descending=2. Default value is 1 (Ascending)

integer

Range: inclusive between 1 and 2

Request Formats

application/json, text/json

Sample:
{
  "title": "sample string 1",
  "stageId": 1,
  "opportunityTypeId": 1,
  "lastUpdatedDateRange": null,
  "pageIndex": 2,
  "pageSize": 3,
  "sortExpression": "sample string 4",
  "sortOrder": 5
}

application/xml, text/xml

Sample:
<OpportunitySearchParameters xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BAPI.Models.CRM">
  <PageIndex xmlns="http://schemas.datacontract.org/2004/07/BAPI.Models">2</PageIndex>
  <PageSize xmlns="http://schemas.datacontract.org/2004/07/BAPI.Models">3</PageSize>
  <SortExpression xmlns="http://schemas.datacontract.org/2004/07/BAPI.Models">sample string 4</SortExpression>
  <SortOrder xmlns="http://schemas.datacontract.org/2004/07/BAPI.Models">5</SortOrder>
  <LastUpdatedDateRange xmlns:d2p1="http://schemas.datacontract.org/2004/07/BAPI.Models" i:nil="true" />
  <OpportunityTypeId>1</OpportunityTypeId>
  <StageId>1</StageId>
  <Title>sample string 1</Title>
</OpportunitySearchParameters>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

SearchResultOfOpportunitySearchResult
NameDescriptionTypeAdditional information
TotalCount

integer

None.

Data

Collection of OpportunitySearchResult

None.

Response Formats

application/json, text/json

Sample:
{
  "totalCount": 1,
  "data": [
    {
      "id": 1,
      "title": "sample string 2",
      "stage": {
        "id": 1,
        "name": "sample string 2"
      },
      "opportunityType": {
        "id": 1,
        "name": "sample string 2"
      },
      "customer": {
        "id": 1,
        "name": "sample string 2"
      },
      "dateCreated": "2024-04-24T09:11:08.6770736-04:00",
      "lastUpdatedDate": "2024-04-24T09:11:08.6770736-04:00"
    },
    {
      "id": 1,
      "title": "sample string 2",
      "stage": {
        "id": 1,
        "name": "sample string 2"
      },
      "opportunityType": {
        "id": 1,
        "name": "sample string 2"
      },
      "customer": {
        "id": 1,
        "name": "sample string 2"
      },
      "dateCreated": "2024-04-24T09:11:08.6770736-04:00",
      "lastUpdatedDate": "2024-04-24T09:11:08.6770736-04:00"
    }
  ]
}

application/xml, text/xml

Sample:
<SearchResultOfOpportunitySearchResultJSBqjE6T xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BAPI.Models">
  <Data xmlns:d2p1="http://schemas.datacontract.org/2004/07/BAPI.Models.CRM">
    <d2p1:OpportunitySearchResult>
      <d2p1:Customer xmlns:d4p1="http://schemas.datacontract.org/2004/07/Striven.Common.Models">
        <d4p1:_x003C_Id_x003E_k__BackingField>1</d4p1:_x003C_Id_x003E_k__BackingField>
        <d4p1:_x003C_Name_x003E_k__BackingField>sample string 2</d4p1:_x003C_Name_x003E_k__BackingField>
      </d2p1:Customer>
      <d2p1:DateCreated>2024-04-24T09:11:08.6770736-04:00</d2p1:DateCreated>
      <d2p1:Id>1</d2p1:Id>
      <d2p1:LastUpdatedDate>2024-04-24T09:11:08.6770736-04:00</d2p1:LastUpdatedDate>
      <d2p1:OpportunityType xmlns:d4p1="http://schemas.datacontract.org/2004/07/Striven.Common.Models">
        <d4p1:_x003C_Id_x003E_k__BackingField>1</d4p1:_x003C_Id_x003E_k__BackingField>
        <d4p1:_x003C_Name_x003E_k__BackingField>sample string 2</d4p1:_x003C_Name_x003E_k__BackingField>
      </d2p1:OpportunityType>
      <d2p1:Stage xmlns:d4p1="http://schemas.datacontract.org/2004/07/Striven.Common.Models">
        <d4p1:_x003C_Id_x003E_k__BackingField>1</d4p1:_x003C_Id_x003E_k__BackingField>
        <d4p1:_x003C_Name_x003E_k__BackingField>sample string 2</d4p1:_x003C_Name_x003E_k__BackingField>
      </d2p1:Stage>
      <d2p1:Title>sample string 2</d2p1:Title>
    </d2p1:OpportunitySearchResult>
    <d2p1:OpportunitySearchResult>
      <d2p1:Customer xmlns:d4p1="http://schemas.datacontract.org/2004/07/Striven.Common.Models">
        <d4p1:_x003C_Id_x003E_k__BackingField>1</d4p1:_x003C_Id_x003E_k__BackingField>
        <d4p1:_x003C_Name_x003E_k__BackingField>sample string 2</d4p1:_x003C_Name_x003E_k__BackingField>
      </d2p1:Customer>
      <d2p1:DateCreated>2024-04-24T09:11:08.6770736-04:00</d2p1:DateCreated>
      <d2p1:Id>1</d2p1:Id>
      <d2p1:LastUpdatedDate>2024-04-24T09:11:08.6770736-04:00</d2p1:LastUpdatedDate>
      <d2p1:OpportunityType xmlns:d4p1="http://schemas.datacontract.org/2004/07/Striven.Common.Models">
        <d4p1:_x003C_Id_x003E_k__BackingField>1</d4p1:_x003C_Id_x003E_k__BackingField>
        <d4p1:_x003C_Name_x003E_k__BackingField>sample string 2</d4p1:_x003C_Name_x003E_k__BackingField>
      </d2p1:OpportunityType>
      <d2p1:Stage xmlns:d4p1="http://schemas.datacontract.org/2004/07/Striven.Common.Models">
        <d4p1:_x003C_Id_x003E_k__BackingField>1</d4p1:_x003C_Id_x003E_k__BackingField>
        <d4p1:_x003C_Name_x003E_k__BackingField>sample string 2</d4p1:_x003C_Name_x003E_k__BackingField>
      </d2p1:Stage>
      <d2p1:Title>sample string 2</d2p1:Title>
    </d2p1:OpportunitySearchResult>
  </Data>
  <TotalCount>1</TotalCount>
</SearchResultOfOpportunitySearchResultJSBqjE6T>