InvokeCreate()

Invokes the Create method on an API object and returns an API status code.

The InvokeCreate() function has four parameters:

  • apiObject (API Object): Required. The API Object to create.
  • statusMessage (AMPscript variable): Required. An AMPscript variable that stores the API status message.
  • errorCode (AMPscript variable): Required. An AMPscript variable that stores the API error code.
  • createOptionsObject (API Object): A CreateOptions API object.

This example creates the TriggeredSend and TriggeredSendDefinition objects as @ts and @tsDef. It also assigns the correct properties to the objects and passes the object into the InvokeCreate call. The InvokeCreate call returns a status code and status message, which you can use for handling exceptions.

In this example, the AMPscript returns errors to the screen.