Create an opportunity import definition

post

/api/bulk/2.0/opportunities/imports

Creates an opportunity import definition. For more information about using these endpoints, see, using the opportunities endpoints.

Request

Supported Media Types
Body ()
The request body contains details of the opportunity import definition.
Root Schema : OpportunityImportIndividual
Type: object
Title: OpportunityImportIndividual
The request body defines the details of the opportunity import definition.
Show Source
Nested Schema : fields
Type: array
Title: fields
List of fields to be included in the operation.
Show Source
Back to Top

Response

Supported Media Types

201 Response

OK.
Body ()
Root Schema : OpportunityImportIndividualResponse
Type: object
Title: OpportunityImportIndividualResponse
The response body includes information about the opportunity import definition.
Show Source
Nested Schema : fields
Type: array
Title: fields
List of fields to be included in the operation.
Show Source

400 Response

Bad request. See Status Codes for information about other possible HTTP status codes.

401 Response

Unauthorized. See Status Codes for information about other possible HTTP status codes.

403 Response

Forbidden. See Status Codes for information about other possible HTTP status codes.

404 Response

The requested resource was not found. See Status Codes for information about other possible HTTP status codes.

409 Response

There was a conflict. See Status Codes for information about other possible HTTP status codes.

410 Response

The requested resource is no longer available. See Status Codes for information about other possible HTTP status codes.

412 Response

The resource you are attempting to delete has dependencies, and cannot be deleted. See Status Codes for information about other possible HTTP status codes.

413 Response

Storage space exceeded. See Status Codes for information about other possible HTTP status codes.

500 Response

The service has encountered an internal server error. See Status Codes for information about other possible HTTP status codes.

503 Response

There was a timeout processing the request. See Status Codes for information about other possible HTTP status codes.
Back to Top

Examples

The following examples demonstrate how to create a new opportunity import definition using an HTTP request and cURL. For more information on requests, see API requests.

HTTP Request Example

Create a new opportunity import definition:


POST /opportunities/imports
Content-Type: application/json 
			

Request body:


{
  "name": "Opportunity Import",
  "fields": {
    "OpportunityID": "{{Opportunity.Id}}",
    "OpportunityName": "{{Opportunity.Field(Name)}}",
    "AccountName": "{{Opportunity.Field(AccountName)}}",
    "CreatedDate": "{{Opportunity.CreatedAt}}",
    "Amount": "{{Opportunity.Field(Amount)}}",
    "CloseDate": "{{Opportunity.Field(CloseDate)}}",
    "Currency": "{{Opportunity.Field(Currency)}}",
    "ForecastToCloseDate": "{{Opportunity.Field(ForecastToCloseDate)}}",
    "Stage": "{{Opportunity.Field(Stage)}}",
    "Territory": "{{Opportunity.Field(Territory)}}"
  },
  "identifierFieldName": "OpportunityID",
  "isIdentifierFieldCaseSensitive": false
}
			

The request body must contain the following opportunity fields:

  • {{Opportunity.Id}}
  • {{Opportunity.Field(Name)}}
  • {{Opportunity.Field(Stage)}}
  • {{Opportunity.Field(Amount)}}

The request body must also contain identifierFieldName with the {{Opportunity.Id}} field in the fields.

Response:


{
  "isIdentifierFieldCaseSensitive": false,
  "name": "Opportunity Import",
  "fields": {
    "OpportunityID": "{{Opportunity.Id}}",
    "OpportunityName": "{{Opportunity.Field(Name)}}",
    "AccountName": "{{Opportunity.Field(AccountName)}}",
    "CreatedDate": "{{Opportunity.CreatedAt}}",
    "Amount": "{{Opportunity.Field(Amount)}}",
    "CloseDate": "{{Opportunity.Field(CloseDate)}}",
    "Currency": "{{Opportunity.Field(Currency)}}",
    "ForecastToCloseDate": "{{Opportunity.Field(ForecastToCloseDate)}}",
    "Stage": "{{Opportunity.Field(Stage)}}",
    "Territory": "{{Opportunity.Field(Territory)}}"
  },
  "identifierFieldName": "OpportunityID",
  "isSyncTriggeredOnImport": false,
  "dataRetentionDuration": "P7D",
  "uri": "/opportunities/imports/24",
  "createdBy": "API.User",
  "createdAt": "2018-02-15T15:28:32.4730364Z",
  "updatedBy": "API.User",
  "updatedAt": "2018-02-15T15:28:32.4730364Z"
}
			

cURL Example

Here is the same example in cURL given an instance with the name APITest, username API.User, and POD of 3.


curl --user "APITest\API.User" --header "Content-Type: application/json" --request POST --data '{"name":"Opportunity Import","fields":{"OpportunityID":"{{Opportunity.Id}}","OpportunityName":"{{Opportunity.Field(Name)}}","AccountName":"{{Opportunity.Field(AccountName)}}","CreatedDate":"{{Opportunity.CreatedAt}}","Amount":"{{Opportunity.Field(Amount)}}","CloseDate":"{{Opportunity.Field(CloseDate)}}","Currency":"{{Opportunity.Field(Currency)}}","ForecastToCloseDate":"{{Opportunity.Field(ForecastToCloseDate)}}","Stage":"{{Opportunity.Field(Stage)}}","Territory":"{{Opportunity.Field(Territory)}}"},"identifierFieldName":"OpportunityID","isIdentifierFieldCaseSensitive":false}' https://secure.p03.eloqua.com/api/bulk/2.0/opportunities/imports
			
Back to Top