Table of Contents

REST request path parameters

The URL for REST API is

app.e-marketer.io/rest/{OBJECT}

Path parameters can be added to the request to select records by condition and sort the result.

Select by record Id

If the first parameter is number, like in app.e-marketer.io/rest/placeholders/14, this number will be used as record Id. So this request asks for placeholder Id 14.

app.e-marketer.io/rest/{OBJECT}/{NUMBER}

“Where”: Select by other column

It’s possible to select by name or by any other available columns. The syntax will be

app.e-marketer.io/rest/{OBJECT}/where/{COLUMN}={VALUE}

One example:

curl 'https://api:FD09908F25BECB09D78EBEA1DADFB618651F612D@app/.e-marketer.io/rest/placeholders/where/name=Fake'

We put “=” sign between {COLUMN} and {VALUE}, but there are other operations available:

  • = – equals
  • != – doesn’t equal
  • > – greater than
  • < – less than
  • >= – greater or equal
  • <= – less or equal
  • : – in comma-list of values
  • !: – not in comma-list of values

For several conditions that all must be met, use & (“and” operator).

app.e-marketer.io/rest/{OBJECT}/where/{COLUMN1}={VALUE1}&{COLUMN2}={VALUE2}&...

For several conditions that at least one of them must be met, use | (“or” operator).

app.e-marketer.io/rest/{OBJECT}/where/{COLUMN1}={VALUE1}|{COLUMN2}={VALUE2}|...

And you can combine both. “And” operator has higher precedence than “or”, like multiplication over addition in algebra. Parentheses are not supported.

“Order_by”: Sort the result

app.e-marketer.io/rest/{OBJECT}/order_by/{COLUMN},{COLUMN},...

The resulting records will be sorted in ascending order by one or several columns.

app.e-marketer.io/rest/{OBJECT}/order_by_desc/{COLUMN},{COLUMN},...

In descending order.

“Limit”: How many records to get

app.e-marketer.io/rest/{OBJECT}/limit/{LIMIT}

After sorting you may want to get top several records.

app.e-marketer.io/rest/{OBJECT}/limit/{OFFSET},{LIMIT}

Skip {OFFSET} records, then get {LIMIT} records. So it’s possible to implement pagination.

“Columns”: Get only specific columns for each record

app.e-marketer.io/rest/{OBJECT}/columns/{COLUMN1},{COLUMN2},...

Without “columns”, API returns all available columns for given object.

“Column”: Get only one specific column

app.e-marketer.io/rest/{OBJECT}/column/{COLUMN}

This changes format of resulting JSON value. The result will be 1-dimensional array of values of the given column. Normally (without “column”) it’s array of JSON objects.