Create via WSProxy
To create a single item or several items of the same type in a single call, use the createItem and createBatch functions.
- For the first parameter, both functions take the object type to perform the action on. For example, Email or DataExtension.
- The second parameter is a JS object which represents the fields and values to set on the object when created. For batch operations, the second parameter is passed in as an Array of objects instead of a single item.
- The third parameter is optional and includes any properties to be set using the SOAP CreateOptions object.
This example creates a single DataExtension object with two fields: ID and Name.
This example creates two similar data extensions using the createBatch function.
In both single and batch operations, the results contain three properties from the SOAP CreateResult object: “Status”, “RequestID”, and “Results”. The createItem method returns one item, and the createBatch method returns as many items as were passed into the method.
This example creates an automation activity and includes the Raw SOAP Wrapper which corresponds with the WSProxy call.
The WSProxy object only allows for Update and Perform, at this time, so you can’t create a data extract with WSProxy directly. Update is only for the top level object (like the name of the Extract or the customerkey).
However, you can use the following REST endpoint to create a Data Extract.
Endpoint for Data Extract Creation:
For the dataExtractTypeId the Id for a Data Extension Extract is: bb94a04d-9632-4623-be47-daabc3f588a6.
Endpoint for Data Extract Type ID:
You also need to know where to put the identifier for the DE you want to target. This can be found in the dataFields array inside the DECustomerKey object. Inside the 'value' property, you will write the CustomerKey of your target DE.
Create the Data Extract and perform it (you can use the WSProxy or REST API to start it), using the examples below as a guide.
Endpoint to start Data Extract:
WSProxy for starting Extract:
After creating the Extract, use File Transfers to move the extracts from your repository to the correct FTP directory.