Get Opportunity

Description

Retrieves opportunity information by ID. Can return either pre-visit or post-visit opportunities based on the specified type.


HTTP Method

get


URL

/api/v2/opportunities/{OpportunityId}

Query Parameters

Parameter


Type


Location


Required


Description


OpportunityId integer Route Yes The unique identifier of the opportunity (minimum value: 1)
LanguageId integer Query No Language ID for localized content (default: 1)
opportunityType string Query No Type of opportunity: "Pre" or "Post". If not specified, returns both types if available

Request Examples

# Get specific pre-visit opportunity
GET /api/v2/opportunities/123?opportunityType=Pre&LanguageId=1
Authorization: Bearer {your-token}
# Get specific post-visit opportunity
GET /api/v2/opportunities/456?opportunityType=Post
Authorization: Bearer {your-token}
# Get both pre and post opportunities (if available)
GET /api/v2/opportunities/789
Authorization: Bearer {your-token}

Response Structure

Success Response (200 OK)

[
  {
    "Type": "Pre",
    "ID": 123,
    "VisitID": 456,
    "CustomerID": 789,
    "OpportunityName": "New Product Launch",
    "OpportunityID": "OPP-2024-001",
    "OpportunityCategoryID": 1,
    "OpportunityStageID": 2,
    "OpportunityCompetitorID": 3,
    "AcctPotential": 150000.00,
    "SalesRevenue": 75000.00,
    "PendingCloseDate": "2024-12-31",
    "VisitCustomerOpportunityID": null,
    "FollowUpSentDate": null
  }
]

Response Codes

Code


Description


Response Type


200 Success Array of V2OpportunityPrePostFlat
400 Bad Request string
401 Not Authorized string
404 Not Found ObjectNotFoundResponse
500 Internal Server Error InternalServerErrorResponse