Document & Email Generator REST APIs

Overview

Document Generator

The Document Generator REST APIs allow an external system to send a REST call to generate a document using a Document Designer template and retrieve generated documents.

Email Generator

The Email Generator REST APIs allow an external system to send a REST call to generate an email document using an Email Designer template and retrieve generated email documents. When executed correctly, the external system will receive the URL of the generated HTML email in the Location header of the REST response from CPQ.

AdminiStration

Document Generator REST APIs

ClosedGenerate Document

 Generate DocumentPOST method

Description

This operation generates a document using a Document Designer template. Generated documents will remain on your site for 24 hours.

URI Endpoint

/rest/v17/documentGenerator

HTTP Method

POST

Request Body Parameters

 

 

 

 

processVarname

The Commerce process variable name

templateName

The Document Designer template name

transactionId

The Commerce Transaction Id

languageCode

The language integer value to specify the template language.

Refer to Supported Languages to identify integer values.

outputFormat

The output format options available are as follows (separated by comma): PDF, DOCX, RTF

Response Header

When executed correctly, the external system will receive the URL of the document in the Location header of the REST response from CPQ.

Response Body Parameters

This task does not return elements in the response body.

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v17/documentGenerator


ClosedSample Request Body

{ "processVarname": "oraclecpqo", "templateName": "Proposal Document", "transactionId": 5531903, "languageCode": -1, "outputFormat": "PDF" }


ClosedGet Generated Document

Get Generated Document GET Method

Description

This operation will retrieve a recently generated document.

URI Endpoint

/rest/v17/documentGenerator/{id}

Endpoint Parameters

id

The generated document ID

HTTP Method

GET

Request Body Parameters

None (nothing should be in the request payload)

Response Body Parameters

 

 

 

 

fileName

The file name

fileFormat

The format of the file

mimeType

The MIME type of the document

printType

Print type of the document

languageCode

The language integer value to specify the template language.

Refer to Supported Languages to identify integer values.

document

Document in Base64 encoded format.

If the requested media type is octet-stream, response will not contain any body parameters. Instead it will be a binary stream that is the document itself. Binary streams are more bandwidth efficient than base64 format.

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v17/documentGenerator/5607404


Text file iconSample Response Body


ClosedGet Generated Document List

 Get Generated Document ListGET Method

Description

This operation retrieves a list of recently generated documents.

URI Endpoint

/rest/v17/documentGenerator

Endpoint Parameters

None

HTTP Method

GET

Request Body Parameters

None (nothing should be in the request payload)

Response Body Parameters

 

 

 

JSON data containing a list of available documents.

templateName

The Document Designer template name

id

The generated document Id

processVarName

The variable name of the Commerce process

languageCode

The language integer value to specify the template language.

Refer to Supported Languages to identify integer values.

outputFormat

The output format options available are as follows (separated by comma): PDF, DOCX, RTF.

transactionId

The Commerce Transaction identifier

links

Links to generated documents

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v17/documentGenerator


ClosedSample Response Body

{ "items": [{ "templateName": "Proposal Document", "id": 5607404, "processVarname": "oraclecpqo", "languageCode": -1, "outputFormat": "PDF", "transactionId": 5531903, "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/documentGenerator/5607404" } ] }, { "templateName": "Contract Document",           "id": 5607142, "processVarname": "oraclecpqo", "languageCode": -1, "outputFormat": "PDF", "transactionId": 5531903, "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/documentGenerator/5607142" } ] } ], "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/documentGenerator" } ] }


Email Generator REST APIs

ClosedGenerate Email

 Generate EmailPOST method

Description

This operation creates an html email document using an Email Designer template and the specified Transaction data. Generated email documents will remain on your site for 24 hours.

URI Endpoint

/rest/v17/emailGenerator

Endpoint Parameters

id

The generated Email document identifier

HTTP Method

POST

Request Body Parameters

 

 

 

 

processVarname

The Commerce process variable name

templateName

The Email Designer template name

transactionId

The Commerce Transaction Id

languageCode

The language integer value to specify the template language.

Refer to Supported Languages to identify integer values.

Response Body Parameters

No content. This task does not return elements in the response body.

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v17/emailGenerator


ClosedSample Request Body

{ "processVarname": "oraclecpqo", "templateName": "Generic Approval Notification", "transactionId": 5531903, "languageCode": -1 }


ClosedGet Generated Email

Get Generated Email GET Method

Description

This operation will retrieve the specified generated email document.

URI Endpoint

/rest/v17/emailGenerator/{id}

Endpoint Parameters

id

The generated Email document identifier

HTTP Method

GET

Request Body Parameters

None (nothing should be in the request payload)

Response Body Parameters

 

subject

The subject of the email

body

The body of the email, which contains the generated email document.

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v17/emailGenerator/5606997


Text file icon Sample Response Body


ClosedGet Generated Email List

 Get Generated Email List GET Method

Description

This operation retrieves a list of recently generated email documents.

URI Endpoint

/rest/v17/emailGenerator

Endpoint Parameters

None

HTTP Method

GET

Request Body Parameters

None (nothing should be in the request payload)

Response Body Parameters

 

JSON data containing a list of available document templates.

templateName

The Email Designer template name

id

The generated Email document identifier

processVarName

The variable name of the Commerce process

languageCode

The language integer value to specify the template language.

Refer to Supported Languages to identify integer values.

transactionId

The Commerce Transaction identifier

links

Links to generated email documents

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v17/emailGenerator


ClosedSample Response Body

{ "items": [{ "id": "5606997", "languageCode": -1, "transactionId": "5531903", "processVarname": "oraclecpqo", "templateName": "Pending Approval Notification", "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/emailGenerator/5606997" } ] }, { "id": "5606999", "languageCode": 2, "transactionId": "5531903", "processVarname": "oraclecpqo", "templateName": "Pending Approval Notification", "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/emailGenerator/5606999" } ] }, { "id": "5607001", "languageCode": -1, "transactionId": "5531903", "processVarname": "oraclecpqo", "templateName": "Quote Summary", "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/emailGenerator/5607001" } ] }, { "id": "5607028", "languageCode": 2, "transactionId": "5531903", "processVarname": "oraclecpqo" , "templateName": "Quote Summary", "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/emailGenerator/5607028" } ] } ], "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/emailGenerator" } ] }


Additional Information

ClosedAuthentication

Oracle CPQ uses HTTP Basic authentication to authenticate REST calls from third-party systems. When making a call to an Oracle CPQ REST API, the third-party system’s REST client must have encrypted Oracle CPQ login credentials in the Header and an Accept Header that both adhere to HTTP Basic authentication standards. The Accept Header must be set to application/json. For more information see the topic Supported REST Headers.


ClosedREST API Metadata

In addition to getting the schema through a GET call, administrators can access the resource’s metadata schema through the Interface Catalogs. Navigate to the Interface Catalogs by clicking Admin to go to the Admin Home Page and then clicking Interface Catalogs in the Integration Platform section. Clicking the documentGeneratoror emailGenerator resource will open the metadata schema in a new window.


Notes

Notes:

  • Even if an Oracle CPQ site only has one supported language, that language’s code must still be included in the body of the POST REST call.
  • Only deployed Document and Email Designer templates can produce a document via a REST call.
  • The URL generated by the REST call is valid for 24 hours.

Related Topics

Related Topics Link IconSee Also