• Venue and event management in the cloud

How Can We Help?


Opportunities

In this article


REST API Opportunities

POST /v1/opportunities/

Creates an opportunity.

The contact’s first name, last name and email address (case insensitive) are used to match a contact to an existing contact in Priava.

A new contact will be created only if one cannot be matched.

When a user provides an organisation:

  1. If the contact exists, there is no change to its organisation and it is ignored.
  2. If the organisation exists, but the contact doesn’t exist then a new contact is created and associated to the existing organisation.
  3. If the organisation and the contact don’t exist, the organisation will be created with the contact’s telephone and email address. The contact will be associated to this new organisation.

Request:
A JSON POST request body expecting APIToken in the request header which re-authenticates the user with each request.


Parameter
id string

This parameter is ignored when creating an Opportunity.

name string

The contact’s last name.

pax string
REQUIRED

The number of persons the Opportunity is for. Must be a non-negative integer value.

eventType string
REQUIRED

The type of Event the Opportunity is for. You should populate a drop down list with a call from GET Event Types to get a list of the Event Types and their relevant ID’s.

startDate string
REQUIRED

The start date for the opportunity in date time format.

opportunityStatus string
REQUIRED

The opportunity status name e.g. Open or Web – Open. Must match an opportunity status that is set up in Priava.

contactType string
REQUIRED

The contact type of the contact associated to the Opportunity. Must match a contact type that is set up in Priava.

opportunitySource string
REQUIRED

The source of the Opportunity. You should populate a drop down list with a call from GET Opportunity\Event Source to get a list of the Opportunity\Event Source and their relevant ID’s or pre-populate this field with a valid ID and Name.

firstName string
REQUIRED

The contact’s first name.

lastName string
REQUIRED

The contact’s last name.

email string
REQUIRED

The contact’s email address.

mobile string
REQUIRED*

The contact’s mobile number

phone string
REQUIRED*

The contact’s phone number.

organisation string

The contact’s Organisation / Company name.

venues string

A collection of Venues associated to the Opportunity. You should populate a multi-select UI element with a call from GET Venues to get a list of the Venues and their relevant ID’s or pre-populate this field with a valid ID and Name.

commentType string
REQUIRED **

The type of comment as per the Priava Comment Type setup for your system. Must match a comment type that is set up in Priava. ‘System’ is not a valid comment type.

comment string
REQUIRED**

The comment associated to the Opportunity with comment type of commentType.

 

{
"id": null, "name": "name", "pax": "40", "eventType":{ "id": "12345", "name": "Birthday Party" }, "startDate": "01/01/2015 14:00:00", "endDate": "01/01/2015 17:00:00", "opportunityStatus": "Web Enquiry", "opportunitySource":{ "id": "23535", "name": "Web" }, "firstName": "John", "lastName": "Smith", "email": "john.smith@acme.com", "mobile": "+61123456789", "phone": "+61123456789", "organisation":"Acme", "contactType": "Debtor", "venues":[{ "id": "12345", "name": "Lounge Area" }, { "id": "232323", "name": "Cocktail Bar" }], "commentType": "General", "comment": "This is an enquiry for booking Lounge Area and Cocktail Bar for my Birthday party"
}
Response:
{  
“success”: “true”,
“result”: "252"
}

* Either a phone or mobile number is required (not both) in order to create a contact.
** If a comment is added via the comments property, then the commentType must be added also.