• Version: 1.2.0

Entries

Entries are rows of data stored in certain types of flows. The following endpoints can be accessed by the entries endpoint:

That means you can add any of these items through an entries endpoint. But more importantly, you use this endpoint to create and manage items in any custom flows that you have created. Your custom flows won’t have their own endpoints, so this is the only way to create, modify, and delete those items. Entry data fields will vary depending on which type you are using, but they all have these fields:

Key Type Required Unique Details
id Integer No Yes Automatically populated when you create the entry.
order Array No No An order that this entry is associated with.
created_at String No No Automatically populated when you create the entry.
updated_at String No No Automatically populated when you modify the entry.

You can call the entries endpoint using either the slug or ID number of the flow that you want to affect. For example:

  • https://api.molt.in/v1/flows/categories/entries
  • https://api.molt.in/v1/flows/4/entries

will both access the same data.

Before you can use this (or any endpoint), you need to authenticate to get a bearer token.

This topic will cover the following processes:

Create a New Entry

When you create entries, you need to use the data fields required by the specific flow. Like creating entries through their built-in endpoints, you need to supply at least the data fields marked required. You can view the fields required by any flow through a GET call on the https://api.molt.in/v1/flows/{ID or slug}/fields endpoint. You can put data fields in any order.

curl -X POST https://api.molt.in/v1/flows/shipping/entries \
  -H "Authorization: Bearer XXXX" \
  -d "title=Digital Download" \
  -d "slug=digital_download" \
  -d "company=none" \
  -d "status=1" \
  -d "tax_band=1018614836851901054" \
  -d "price=0"

A successful call will return a 200 OK HTML status code and information for the newly created entry based on the flow that the entry was created for. For existing flows, consult the topic about that flow for more information about what this object will look like. For custom flows, the returned information will contain the fields that you have configured.

Retrieve Entry Information

You have two methods to retrieve information about the entries in a flow. The first requires that you know the ID number of the specific entry that you want, and it returns solely the information for that one entry. The second returns an array of entries that you can limit by field values, specify a maximum number to return, and offset the start of the array. Using the last two options, you can paginate results by increasing the offset of a search by the previous maximum.

Retrieve a Single Entry by ID

You can GET information for a single entry by adding the ID number to the entries endpoint. No additional data fields are required.

curl -X GET https://api.molt.in/v1/flows/shipping/entries/1066841243138392551 \
	-H "Authorization: Bearer XXXX"

On success, this returns a 200 OK status code and the entry information for the selected ID number.

Retrieve a List of All Entries in a Flow

Using the entries endpoint for a flow, you can return an array that contains all of the entries that you have created.

curl -X GET https://api.molt.in/v1/flows/shipping/entries \
  -H "Authorization: Bearer XXXX"

On success, this will return 200 OK and an array of entry information, even if there is only one entry.

Edit an Entry

To change one or more values in a single entry, use a PUT call with the flows/{flow name}/entries/{ID number} endpoint. You can change most field values through this method, though the specific fields available will depend on the flow.

curl -X PUT https://api.molt.in/v1/flows/shipping/entries/1066841243138392551 \
  -H "Authorization: Bearer XXXX" \
  -d "company=rackspace"

On success, this returns 200 OK and the updated entry information.

Delete a Single Entry

To remove an entry, use the same flows/{flow name}/entries/{ID number} endpoint we used to retrieve a single entry, except we use the DELETE request method.

curl -X DELETE https://api.molt.in/v1/flows/shipping/entries/1066841243138392551 \
	-H "Authorization: Bearer XXXX"

If successful, this call returns 200 OK and the following:

{
	"status":true,
	"message":"Entry deleted successfully"
}