Prepr Documentation

Prepr Documentation

Welcome to the Prepr Documentation. You'll find comprehensive guides and documentation to help you start working with Prepr as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    
Suggest Edits

And now your Prepr journey begins!

 

Overview

This is reference documentation for the Prepr REST API.

The API provides programmatic access to all of the key parts of Prepr. To get started
with the API, you'll need to created an lifetime access token first.

Making a request

Making a request to our API is as simple as issuing an HTTP GET request. You can make these requests using the mechanism of your choosing. For debugging and developing our team uses Postman.

GET /publications?access_token={{access_token}} HTTP/1.0

More about the basis in our guide Basics explained and some advanced functions Overview and Best Practices .

Interpreting the Response

All API endpoints will return a HTTP status code that matches the state of your request. The status codes are explained in the Response Codes guide.

Suggest Edits

/publications

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/publications
curl --request GET \
  --url https://api.eu1.prepr.io/publications
var request = require("request");

var options = { method: 'GET', url: 'https://api.eu1.prepr.io/publications' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/publications")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/publications");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/publications"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "items": [
        {
            "id": "93fb1b38-9a85-4d6e-9639-8c4a8a88454a",
            "created_on": "2019-01-14T19:52:58+00:00",
            "changed_on": null,
            "label": "Publication",
            "slug": {
                "en-EN": "publication-model-two-21"
            },
            "publish_on": {
                "en-EN": "2019-01-11T13:24:34+00:00"
            },
            "status": {
                "en-EN": {
                    "id": "7f18224a-437b-4421-a7ce-6551d177c53e",
                    "created_on": "2018-12-24T09:09:25+00:00",
                    "changed_on": null,
                    "label": "Status",
                    "body": "Done"
                }
            }
        },
        {
					// ....
        }
    ],
    "total": 2,
    "after": "YWZ0ZXJfMjU=",
    "before": "YmVmb3JlXzA=",
    "skip": 0,
    "limit": 25
}
 

Sorting publications

created_on,
-created_on,
changed_on,
-changed_on,
publish_on,
-publish_on

{
	"sort" : "created_on"
}

Sorting on publish_on

Because the publish_on param of a Publication is localized, if no locale param is present the API will sort on the default Environment locale.

Filtering publications

Here you will find everything you need to learn how the query Prepr.

eq (equal)

The eq operator checks that the field matches the described value exactly. It takes a single value for filtering.

{
	"{field}" : [
		{
			"eq" : "To do",
			"param" : "{param}" // Optional
		}
	]
}

all

The all operator filters all publications matching a specific set of values.

{
	"{field}" : [
		{
			"all" : [
				"42314cdb-5705-4f6c-b190-74ca06fb83f1",
				"0e45b74b-e6b7-b346-7b64-a8e446232d76"      
			],
			"param" : "{param}" // Optional
		}
	]
}

in

The in operator filters a field by multiple values. The publication must match at least one of them.

{
	"{field}" : [
		{
			"in" : [
				"42314cdb-5705-4f6c-b190-74ca06fb83f1",
				"0e45b74b-e6b7-b346-7b64-a8e446232d76"      
			],
			"param" : "{param}" // Optional
		}
	]
}

has

The has operator filters a field by checking the existence. The publication must have at least one field.

{
	"{field}" : [
		{
			"has" : true
		}
	]
}

sw (starts with)

The sw operator filters a field by checking the start of a string value.

{
	"{field}" : [
		{
			"sw" : "news/trump-in-the"
		}
	]
}

Model

Filter publications on the Publication Model.

{
	"model" : { 
		"id" : "One"
	}
}

Status

/statuses

Supported operators: eq, in.

{
	"status" : [
		{
			"eq" : "To do",
			"in" : [
				"Done", "To do"
			]
		}
	]
}

Querying eq status 'Done' is optimized and will respond faster than a multi-status request if a locale is specified.

Locales

/locales

Supported operators: eq, in.

{
	"locales" : [
		{
			"eq" : "en-EN",
			"in" : [
				"en-EN", "en-US"
			]
		}
	]
}

Please note that an Publication only gets a locale link when at least one field is filled for that locale.

Created by

/users

Supported operators: eq, in.

{
	"created_by" : [
		{
			"eq" : "bcc9eea7-7307-f45b-5aaf-27eca7d329f9",
			"in" : [
				"222b7528-9e3a-294f-21bf-7ec623d1ac74",
				"bcc9eea7-7307-f45b-5aaf-27eca7d329f9"
			]
		}
	]
}

Assigned to

/users

Supported operators: eq, in.

{
	"assigned_to" : [
		{
			"eq" : "bcc9eea7-7307-f45b-5aaf-27eca7d329f9",
			"in" : [
				"222b7528-9e3a-294f-21bf-7ec623d1ac74",
				"bcc9eea7-7307-f45b-5aaf-27eca7d329f9"
			]
		}
	]
}

Channel

/channels

Supported operators: eq, in.
Supported params: Id (default), Slug, Body.

{
	"channels" : [
		{
			"eq" : "bcc9eea7-7307-f45b-5aaf-27eca7d329f9",
			"in" : [
				"222b7528-9e3a-294f-21bf-7ec623d1ac74",
				"bcc9eea7-7307-f45b-5aaf-27eca7d329f9"
			],
			"param" : "Id"
		}
	]
}

Tag

The tags filters on all the tags associated with the publication.

Supported operators: eq, all, in, has.
Supported params: id (default), slug, body.

{
	"tags" : [
		{
			"eq" : "bcc9eea7-7307-f45b-5aaf-27eca7d329f9",
			"all" : [
				"222b7528-9e3a-294f-21bf-7ec623d1ac74",
				"bcc9eea7-7307-f45b-5aaf-27eca7d329f9"
			],
			"in" : [
				"222b7528-9e3a-294f-21bf-7ec623d1ac74",
				"bcc9eea7-7307-f45b-5aaf-27eca7d329f9"
			],
			"has" : true,
			"param" : "Id"
		}
	]
}

Containers (stories)

/containers

Supported operators: eq, in.

{
	"conainers" : [
		{
			"eq" : "bcc9eea7-7307-f45b-5aaf-27eca7d329f9",
			"in" : [
				"222b7528-9e3a-294f-21bf-7ec623d1ac74",
				"bcc9eea7-7307-f45b-5aaf-27eca7d329f9"
			]
		}
	]
}

Slug

Supported operators: eq, sw.
Requires locale, requires model for a unique result.

{
	"slug" : [
		{
			"eq" : "nieuws/388107-beelden-paaseiland-wandelden-over-het-eiland.html"
		},
		{
			"sw" : "nieuws/388107-be"
		}
	]
}

Search

Filter publications by searching in all text fields with fuzzy search.

Supported operators: fz.

{
	"q" : [
		{
			"fz" : "Our character is what we do when we think no one is looking"
		}	
	]
}

Search in Title (field) only

Filter publications by searching in the title field with fuzzy search.

Supported operators: fz.

{
	"title" : [
		{
			"fz" : "Our character is what we do when we think no one is looking"
		}	
	]
}

Dates

The date filter can be used with the operators eq, lt, gt and accepts UTC timestamps.

{
	"created_on" : [
		{
			"eq" : "2019-01-08T14:10:58+00:00", // Optimized
			"lt" : "2019-01-08T14:10:58+00:00", // Optimized (if used with gt)
			"gt" : "2019-01-08T14:10:58+00:00",
		}	
	],
	"changed_on" : [
		{
			"eq" : "2019-01-08T14:10:58+00:00",
			"lt" : "2019-01-08T14:10:58+00:00",
			"gt" : "2019-01-08T14:10:58+00:00",
		}	
	],
	"publish_on" : [
		{
			"eq" : "2019-01-08T14:10:58+00:00", // Optimized
			"lt" : "2019-01-08T14:10:58+00:00", // Optimized (if used with gt)
			"gt" : "2019-01-08T14:10:58+00:00",
		}	
	],
	"expire_on" : [
		{
			"eq" : "2019-01-08T14:10:58+00:00", // Coming soon
			"lt" : "2019-01-08T14:10:58+00:00", // Coming soon
			"gt" : "2019-01-08T14:10:58+00:00", // Coming soon
		}	
	]
}

When querying publish_on without a locale specified the results will be accurate in a one hour window.

Querying created_on/publish_on eq or gt with lt is optimized and will respond much faster than other range requests.

Filtering on API fields

Publications can be filtered on the content of a data field. When filtering on a field setting the model is required.

Field type: DateTimeRange

The date filter can be used with the operators lt, lte, gt, gte and accepts UTC timestamps.

{
	"model" : {
		"id" : "50a315ea-2f-4c0c-837a2c8b2c1e89c"
	},
	
	"items" : {
		"de-DE" : {
			"date" : [
				{
					"gte" : 1577239200,
					"lte" : 1677239200
				}
			]		
		}
	}
}

In this example the DateTimeRange field is called date.

Location proximity search

Coming soon!

You can use a proximity search on publications with a location field to find results in a specified geographical area.

Queries that include exact coordinates can't take advantage of caching. In many use cases it should be enough to round the coordinates to 3 decimal places (an accuracy of about 300m), 2 decimal places (an accuracy of about 1km) or more to improve your cache hit rates.

Scopes: publications.

Suggest Edits

/publications

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
posthttps://api.eu1.prepr.io/publications
curl --request POST \
  --url https://api.eu1.prepr.io/publications
var request = require("request");

var options = { method: 'POST', url: 'https://api.eu1.prepr.io/publications' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/publications")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.eu1.prepr.io/publications");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/publications"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
	// Returns the same result as GET /publications/{id}
}

Body Params

model
object
 
model.id
string
items
mixed type
locales
array of strings
required

Locales (min: 1)

status
object
 
status.*
object
 
status.*.body
string
publish_on
object
 
publish_on.*
date-time

UTC timestamp

expire_on
object
 
expire_on.*
date-time

UTC timestamp

channels
object
 
channels.*
object
 
channels.*.id
string
containers
object
 
containers.*
object
 
containers.*.id
string
assigned_to
object
 
assigned_to.*
object
 
assigned_to.*.id
string

/users (id)

 
{
	"model" : { 
		"id" : "8ca916d8-ba5c-4c6b-a91a-4c4fb2213879"
	},
	"publish_on" : {
		"en-EN" : "1546956658", // UTC TIMESTAMP
		"nl-NL" : "1546351870"
	},
	"expire_on" : {
		"en-EN" : "1546956658",
		"nl-NL" : "1546351870"
	},
	"status" : {
		"en-EN" : {
			"body" : "To do"
		},
		"nl-NL" : {
			"body" : "Done"
		}
	},
	"channels" : [
		{
			"id" : "ddc429a1-2bf1-cf99-5bbe-76ad8f3b6334"
		}
	],
	"containers" : [
		{
			"id" : "5776f710-5d3d-3c8e-c9c6-e4a56579218c"
		}
	],
	"assigned_to" : {
		"en-EN" : {
			"id" : "52475775"
		},
		"nl-NL" : {
			"id" : "392185ba-d803-41ab-8a35-88018123aa5c"
		}
	},
	"locales" : [
		"en-EN",
		"nl-NL"
	],
	"items" : {
		"en-EN" : {
			"title" : {
				"body" : "This is the title",
				"format" : "H6",
				"label" : "Text"
			},
			"summary" : {
				"body" : "En dit is de summary text.",
				"label" : "Text"
			},
			"boolean" : {
				"value" : true
			},
			"integer" : {
				"value" : 3742343
			},
			"float" : {
				"value" : 94.23423
			},
			"bnnvara" : {
				"id" : "384727"
			},
			"quote" : {
				"author" : "Albert Einstein",
				"body" : "If we knew what it was we were doing, it would not be called research, would it?"
			},
			"number" : {
				"title" : "Viering van de liefde in Amsterdam",
				"number" : 349,
				"body" : "mensen",
				"description" : "nemen op 'Viering van de Liefde' afstand van Nashville-verklaring"
			},
			"location" : {
				"latitude" : 21.3137,
				"longitude" : -157.806
			},
			"tags" : {
				"items" : [
					{
						"name" : "airplane"
					}	
				]
			},
			"hours" : [
				{
					"open_day" : 6,
					"open_time" : "12:00",
					"close_day" : 6,
					"close_time" : "17:00"
				}	
			],
			"publication" : {
				"id" : "1852380d-50b1-486e-b8c3-c5b8f45f9ac1"
			},
			"publications" : {
				"items" : [
					{
						"id" : "1852380d-50b1-486e-b8c3-c5b8f45f9ac1"
					},
					{
						"id" : "220e1e38-3e01-40f9-800e-19ec9ebb43d1"
					}
				]
			}
		},
		"nl-NL" : {
			"title" : {
				"body" : "Dit is de titel",
				"format" : "H6",
				"label" : "Text"
			},
			"summary" : {
				"body" : "If we knew what it was we were doing, it would not be called research, would it?",
				"label" : "Text"
			}
		}
	}
}

Scopes: publications, publications_publish.
Events: publication.created.

Suggest Edits

/publications/{id}

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/publications/id
curl --request GET \
  --url https://api.eu1.prepr.io/publications/id
var request = require("request");

var options = { method: 'GET',
  url:
   'https://api.eu1.prepr.io/publications/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/publications/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/publications/id");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/publications/id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "id": "ec21095b-4beb-4cea-890f-1255bbe4a002",
    "created_on": "2019-01-09T15:38:04+00:00",
    "changed_on": null,
    "label": "Publication",
    "publish_on": {
        "en-EN": "2019-01-08T14:10:58+00:00"
    },
    "expire_on": {
        "en-EN": "2019-01-08T14:10:58+00:00"
    },
    "locales": [
        "en-EN"
    ],
    "status": {
        "en-EN": {
            "id": "9246edd8-f67b-45f7-b416-566377789d2c",
            "created_on": "2018-12-24T09:09:25+00:00",
            "changed_on": null,
            "label": "Status",
            "body": "To do"
        }
    },
    "items": {
        "en-EN": {
            "title": {
                "id": "0156ec9a-dbaa-4d35-8efa-e1e9f9c0aac7",
                "created_on": "2019-01-09T15:38:04+00:00",
                "changed_on": null,
                "label": "Text",
                "body": "This is the title",
                "format": "H6"
            },
            "summary": {
                "id": "72c09cbe-aeaf-471a-a0e7-19195cd2899f",
                "created_on": "2019-01-09T15:38:04+00:00",
                "changed_on": null,
                "label": "Text",
                "body": "En dit is de summary text.",
                "format": null
            }
        }
    }
}
{
    "code": 404,
    "message": "Not Found",
    "dbtrace": "GAE.xxxxxxxxxxxxxx"
}

Path Params

id
string
required

Query Params

fields
string
 

Fields: items, title, model, locales, status, environment, created_by, updated_by, assigned_to.
Scopes: publications.

Suggest Edits

/publications/{id}

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
puthttps://api.eu1.prepr.io/publications/id
curl --request PUT \
  --url https://api.eu1.prepr.io/publications/id
var request = require("request");

var options = { method: 'PUT',
  url:
   'https://api.eu1.prepr.io/publications/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/publications/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.eu1.prepr.io/publications/id");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/publications/id"

response = requests.request("PUT", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
	// Returns the same result as GET /publications/{id}
}

Path Params

id
string
required
 

This endpoint is identical to POST, with the exception that label is not required.

Scopes: publications, publications_publish.
Events: publication.changed.

Suggest Edits

/publications/{id}

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
deletehttps://api.eu1.prepr.io/publications/id
curl --request DELETE \
  --url https://api.eu1.prepr.io/publications/id
var request = require("request");

var options = { method: 'DELETE',
  url:
   'https://api.eu1.prepr.io/publications/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/publications/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.eu1.prepr.io/publications/id");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/publications/id"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

// empty response

Path Params

id
string
required
 

Scopes: publications, publications_delete.
Events: publication.deleted.

Suggest Edits

Items explained

 

The Publication items array contains the content of the Publication. For every locale there is a array containing the fields specified by the Publication Model.

"items" : {
  "en-EN" : {
    "{{api_id}}" : {
      "body" : "This is the title",
      "format" : "H6"
  		// For a specification of the fields check the type model below.
    }
  }
}

Format options

Here below you will find a table with all possible text format options.

param value
UI functionality
API value

H1

heading input field

body without html and format specified

H2

heading input field

body without html and format specified

H3

heading input field

body without html and format specified

H4

heading input field

body without html and format specified

H5

heading input field

body without html and format specified

H6

heading input field

body without html and format specified

CODE

raw html input field

body contains html and format specified (this will be used for the UI editor)

null

basic wysiwyg editor input field. (bold, italic, list, list with numbers, link/url)

body contains html and no format specified

"{{api_id}}" : {
	"body" : "This is the title",
	"label" : "Text", // Required inside the Drag-and-drop editor
	"format" : "H6" // Optional
}
"{{api_id}}": {
	"id": "4b950836-f274-4ef2-a91b-efd064b55ae4",
	"created_on": "2019-01-09T20:29:28+00:00",
	"changed_on": null,
	"label": "Text",
	"body": "This is the title",
	"format": "H6"
},
"{{api_id}}" : {
	"body" : "#003366",
	"label" : "Color", // Required inside the Drag-and-drop editor
}
"{{api_id}}": {
	"id": "411c7ddb-58d4-487b-9bd4-9bb43eec279d",
	"created_on": "2019-01-09T20:39:50+00:00",
	"changed_on": null,
	"label": "Color",
	"body": "#003366",
	"format": "Color"
}
 
"{{api_id}}" : {
	"body" : "2020-01-01",
	"label" : "DateTime", // Required inside the Drag-and-drop editor
	"format" : "Y-m-d" // Required inside the Drag-and-drop editor
}
Suggest Edits

DateTimeRange

 
"{{api_id}}" : {
	"from" : "2020-01-01 13:05:09",
	"until" : "2020-09-01 13:05:09",
	"label" : "DateTimeRange",
	"format" : "Y-m-d H:m:s"
}
 
"{{api_id}}" : {
	"value" : true,
	"label" : "Boolean" // Required inside the Drag-and-drop editor
}
"{{api_id}}": {
	"id": "38b6d11b-eaa8-4c3f-bbda-232b4de54501",
	"created_on": "2019-01-09T20:45:51+00:00",
	"changed_on": null,
	"label": "Boolean",
	"value": true
}
Suggest Edits

ElementBox

 
"{{api_id}}": {
	"items": [
      {
        // element 1 
      },
      {
        // element 2
      }
	],
  "label" : "ElementBox"
}
"{{api_id}}": {
	"items": [
      {
        // element 1 
      },
      {
        // element 2
      }
	],
  "label" : "ElementBox"
}
 
"{{api_id}}" : {
	"value" : 5472653,
	"label" : "Integer" // Required inside the Drag-and-drop editor
}
"{{api_id}}": {
	"id": "ca1bded4-edaa-45a1-b7b6-f7fac96a7afd",
	"created_on": "2019-01-09T20:45:51+00:00",
	"changed_on": null,
	"label": "Integer",
	"value": 3742343
}
"{{api_id}}" : {
	"value" : 54.72653,
	"label" : "Float" // Required inside the Drag-and-drop editor
}
"{{api_id}}": {
	"id": "e09b4321-3811-4b6f-9440-26f1290ee402",
	"created_on": "2019-01-09T21:04:48+00:00",
	"changed_on": null,
	"label": "Float",
	"value": 94.23423
},
Suggest Edits

Coordinates

 
"{{api_id}}" : {
	"latitude": "21.3137",
	"longitude": "-157.806",
	"label" : "Coordinates" // Required inside the Drag-and-drop editor
}
"{{api_id}}": {
	"id": "56c9ddb0-1c91-49db-a322-736c5d343280",
	"created_on": "2019-01-07T16:05:08+00:00",
	"changed_on": null,
	"label": "Coordinates",
	"latitude": 21.3137,
	"longitude": -157.806
}
"{{api_id}}" : {
	"author" : "Albert Einstein",
	"body" : "If we knew what it was we were doing, it would not be called research, would it?",
	"label" : "Quote" // Required inside the Drag-and-drop editor
}
"{{api_id}}": {
	"id": "8faf8d54-6b85-44dd-b707-28b058fd939f",
	"created_on": "2019-01-09T20:52:49+00:00",
	"changed_on": null,
	"label": "Quote",
	"body": "If we knew what it was we were doing, it would not be called research, would it?",
	"author": "Albert Einstein"
},
"{{api_id}}" : {
	"title" : "Viering van de liefde in Amsterdam",
	"number" : 349,
	"description" : "nemen op 'Viering van de Liefde' afstand van Nashville-verklaring",
	"body" : "mensen",
	"label" : "Number"
}
"{{api_id}}": {
	"id": "13ff1609-1987-427c-924e-ebf31c4079fe",
	"created_on": "2019-01-09T20:57:44+00:00",
	"changed_on": null,
	"label": "Number",
	"body": "mensen",
	"number": 349,
	"description": "nemen op 'Viering van de Liefde' afstand van Nashville-verklaring",
	"title": "Viering van de liefde in Amsterdam"
},
Suggest Edits

Resource/Link

 
"{{api_id}}" : {
	"url" : "https://nos.nl/artikel/2266773-honderden-nemen-op-viering-van-de-liefde-afstand-van-nashville-verklaring.html",
	"type" : "Webpage", // Webpage, Audio, Video, Document, Other
	"label" : "Resource"
}
 
"{{api_id}}" : {
	"body" : "The world's tallest unoccupied building",
	"sub_title" : "Ryugyong Hotel: The story of North Korea's 'Hotel of Doom'",
	"description" : "In 1987, ground was broken on a grand new hotel in North Korea's capital, Pyongyang.",
	"url" : "https://edition.cnn.com/style/article/ryugyong-hotel-architecture-origins/index.html",
	"url_label" : "Read More..."
}
Suggest Edits

TwitterPost

 
"{{api_id}}" : {
	"url" : "https://twitter.com/realDonaldTrump/status/1083022011574747137",
	"label" : "TwitterPost" // Required inside the Drag-and-drop editor
}
Suggest Edits

InstagramPost

 
"{{api_id}}" : {
	"url" : "https://www.instagram.com/p/BrSs_aglLEb",
	"label" : "InstagramPost" // Required inside the Drag-and-drop editor
}
Suggest Edits

YouTubePost

 
"{{api_id}}" : {
	"url" : "https://www.youtube.com/watch?v=4xgx4k83zzc",
	"label" : "YouTubePost" // Required inside the Drag-and-drop editor
}
Suggest Edits

FacebookPost

 
"{{api_id}}" : {
	"url" : "https://www.facebook.com/openbac/photos/a.560688977339484/2364254840316213",
	"label" : "FacebookPost" // Required inside the Drag-and-drop editor
}
Suggest Edits

VimeoPost

 
"{{api_id}}" : {
	"url" : "https://vimeo.com/190247248",
	"label" : "VimeoPost" // Required inside the Drag-and-drop editor
}
Suggest Edits

SoundCloudPost

 
"{{api_id}}" : {
	"url" : "https://soundcloud.com/summersaltband/driving-to-hawaii",
	"label" : "SoundCloudPost" // Required inside the Drag-and-drop editor
}
Suggest Edits

SpotifyPlaylist

 
"{{api_id}}" : {
	"url" : "https://open.spotify.com/user/11158963147/playlist/6AfkmB7MBUuYJ7oFAvp81G?si=txHmkuucRPuFemHtVx17BQ",
	"label" : "SpotifyPlaylist" // Required inside the Drag-and-drop editor
}
Suggest Edits

QualifioPost

 
"{{api_id}}" : {
	"id" : "87654321",
	"label" : "QualifioPost" // Required inside the Drag-and-drop editor
}
"{{api_id}}": {
	"id": "a734jad-32478623-sdafw4f4jgfj4",
	"created_on": "2019-01-09T20:29:28+00:00",
	"changed_on": null,
	"label": "QualifioPost"
},
Suggest Edits

BnnvaraPost

 
"{{api_id}}" : {
	"id" : "AB6CD2",
	"label" : "BnnvaraPost" // Required inside the Drag-and-drop editor
}
"{{api_id}}": {
	"id": "a734jad",
	"created_on": "2019-01-09T20:29:28+00:00",
	"changed_on": null,
	"label": "BnnvaraPost"
},
Suggest Edits

BusinessHours

 
"{{api_id}}" : [
    {
      "open_day" : 2,
      "open_time" : "08:00",
      "close_day" : 2,
      "close_time" : "19:00"
    }
  ]
}
Suggest Edits

Publications (ref)

 

Publication references can be created as a one to many relationship.

"{{api_id}}" : {
  "items" : [
		{
			"id" : "1852380d-50b1-486e-b8c3-c5b8f45f9ac1"
		},
		{
			"id" : "220e1e38-3e01-40f9-800e-19ec9ebb43d1"
		}
	]
}
"{{api_id}}": {
	"label": "Publication",
	"items": {
		"0": {
			"id": "1852380d-50b1-486e-b8c3-c5b8f45f9ac1",
			"created_on": "2019-01-07T19:59:26+00:00",
			"changed_on": null,
			"label": "Publication"
		},
		"1": {
			"id": "220e1e38-3e01-40f9-800e-19ec9ebb43d1",
			"created_on": "2019-01-07T20:41:03+00:00",
			"changed_on": null,
			"label": "Publication"
		}
	}
}
Suggest Edits

Assets (ref)

 

Asset references can be created as a one to many relationship For uploading assets check out the /assets endpoint (Assets).

Images API

We recommend that you also read about our images api. For further explanation about Cloud Front, nested fields, resizing, source file and cdn file.

Read about the Images API

"{{api_id}}" : {
  "items" : [
		{
			"id" : "1852380d-50b1-486e-b8c3-c5b8f45f9ac1"
		},
		{
			"id" : "220e1e38-3e01-40f9-800e-19ec9ebb43d1"
		}
	]
}
"{{api_id}}": {
	"label": "Asset",
	"items": {
		"0": {
			"id": "1852380d-50b1-486e-b8c3-c5b8f45f9ac1",
			"created_on": "2019-01-07T19:59:26+00:00",
			"changed_on": null,
			"label": "Asset"
		},
		"1": {
			"id": "220e1e38-3e01-40f9-800e-19ec9ebb43d1",
			"created_on": "2019-01-07T20:41:03+00:00",
			"changed_on": null,
			"label": "Asset"
		}
	}
}
Suggest Edits

Tags (ref)

 

Tags references can be created as a one to many relationship.
Tags posted as body are created if they don't exists.

"{{api_id}}" : {
  "items" : [
		{
			"id" : "1852380d-50b1-486e-b8c3-c5b8f45f9ac1", // Optional; Add by Id or body
			"body" : "1852380d-50b1-486e-b8c3-c5b8f45f9ac1" // Optional; Add by Id or body
		},
		{
			"id" : "220e1e38-3e01-40f9-800e-19ec9ebb43d1",  // Optional; Add by Id or body
			"body" : "1852380d-50b1-486e-b8c3-c5b8f45f9ac1" // Optional; Add by Id or body
		}
	]
}
"{{api_id}}": {
	"label": "TagBox",
	"items": {
		"0": {
			"id": "1852380d-50b1-486e-b8c3-c5b8f45f9ac1",
			"created_on": "2018-03-08T15:36:13+00:00",
			"changed_on": "2018-12-17T10:58:16+00:00",
			"label": "Tag",
			"body": "Politics",
			"slug": "politics"
		},
		"1": {
			"id": "5785cd69-fa47-434a-b027-3d3b750c5f69",
			"created_on": "2018-03-08T15:36:13+00:00",
			"changed_on": "2018-12-17T10:58:16+00:00",
			"label": "Tag",
			"body": "Sport",
			"slug": "sport"
		}
	}
}
Suggest Edits

Persons (ref)

 

Person (audience) references can be created as a one to many relationship.

"{{api_id}}" : {
  "items" : [
		{
			"id" : "1852380d-50b1-486e-b8c3-c5b8f45f9ac1"
		},
		{
			"id" : "220e1e38-3e01-40f9-800e-19ec9ebb43d1"
		}
	]
}
"{{api_id}}": {
	"label": "Person",
	"items": {
		"0": {
			"id": "1852380d-50b1-486e-b8c3-c5b8f45f9ac1",
			"created_on": "2019-01-07T19:59:26+00:00",
			"changed_on": null,
			"label": "Person"
		},
		"1": {
			"id": "220e1e38-3e01-40f9-800e-19ec9ebb43d1",
			"created_on": "2019-01-07T20:41:03+00:00",
			"changed_on": null,
			"label": "Person"
		}
	}
}
Suggest Edits

/containers

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/containers
curl --request GET \
  --url https://api.eu1.prepr.io/containers
var request = require("request");

var options = { method: 'GET', url: 'https://api.eu1.prepr.io/containers' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/containers")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/containers");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/containers"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

Try the API to see results
 
Suggest Edits

/channels

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/channels
curl --request GET \
  --url https://api.eu1.prepr.io/channels
var request = require("request");

var options = { method: 'GET', url: 'https://api.eu1.prepr.io/channels' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/channels")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/channels");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/channels"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

Try the API to see results
 

Scopes: channels.

Suggest Edits

/statuses

List of the Prepr Publication statuses

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/statuses
curl --request GET \
  --url https://api.eu1.prepr.io/statuses
var request = require("request");

var options = { method: 'GET', url: 'https://api.eu1.prepr.io/statuses' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/statuses")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/statuses");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/statuses"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "items": [
        {
            "id": "7f18224a-437b-4421-a7ce-6551d177c53e",
            "created_on": "2018-12-24T09:09:25+00:00",
            "changed_on": null,
            "label": "Status",
            "body": "Done"
        },
        {
            "id": "0c734433-0a3e-4f86-b45d-18c3da284772",
            "created_on": "2018-12-24T09:09:25+00:00",
            "changed_on": null,
            "label": "Status",
            "body": "Review"
        },
        {
            "id": "cff13c2a-615a-4f85-a50d-cc05104e6d6b",
            "created_on": "2018-12-24T09:09:25+00:00",
            "changed_on": null,
            "label": "Status",
            "body": "In progress"
        },
        {
            "id": "9246edd8-f67b-45f7-b416-566377789d2c",
            "created_on": "2018-12-24T09:09:25+00:00",
            "changed_on": null,
            "label": "Status",
            "body": "To do"
        },
        {
            "id": "3ad273ed-a525-4300-a9ac-baaaf7621446",
            "created_on": "2018-12-24T09:09:25+00:00",
            "changed_on": null,
            "label": "Status",
            "body": "Archived"
        }
    ]
}
 

Scopes: statuses.

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/locales
curl --request GET \
  --url https://api.eu1.prepr.io/locales
var request = require("request");

var options = { method: 'GET', url: 'https://api.eu1.prepr.io/locales' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/locales")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/locales");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/locales"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "items": [
        {
            "id": "a33baedc-dc4f-488e-9953-2c1cc4ea7232",
            "created_on": "2019-01-10T13:14:20+00:00",
            "changed_on": null,
            "label": "Locale",
            "body": "nl-BE"
        },
        {
            "id": "a10bb394-a1a0-4f34-b427-2c5c487035d2",
            "created_on": "2019-01-10T13:14:29+00:00",
            "changed_on": null,
            "label": "Locale",
            "body": "en-EN"
        },
        {
            "id": "ebc6e749-526c-4785-926b-7b49543ba485",
            "created_on": "2019-01-10T13:14:38+00:00",
            "changed_on": null,
            "label": "Locale",
            "body": "en-US"
        },
        {
            "id": "4a99e697-d08f-41cb-9d78-0eaf2bcc88a1",
            "created_on": "2019-01-10T13:14:43+00:00",
            "changed_on": null,
            "label": "Locale",
            "body": "de-DE"
        },
        {
            "id": "bd97a0c9-c2f9-42e5-b0aa-69b7fb91ea1a",
            "created_on": "2019-01-10T13:13:45+00:00",
            "changed_on": null,
            "label": "Locale",
            "body": "nl-NL"
        }
    ],
    "total": 5,
    "after": "YWZ0ZXJfMjU=",
    "before": "YmVmb3JlXzA=",
    "skip": 0,
    "limit": 25
}

Query Params

fields
string
q
string
sort
string

Possible options: -id,id,-created_on,created_on,-body,body

 
Suggest Edits

Recommendations Concept

 

Recommendations draws on that experience to deliver (personalized) recommendations that suit each users tastes and preferences across all your touchpoints.

Recommendation types

When you start using recommendations, you work with our staff to determine the best recommendation models and customizations to use for your site. The models and customizations you use depend on your business KPI's, and where you plan to display the resulting recommendations.

Available recommendation types

Prepr offers the following recommendation types:

More like this

The "More like this" recommendation predicts interesting publications based on the current specified publication. The prediction is based on both the session history for all users and the candidate publication relevance to a current specified publication. This recommendation type is typically used on a publication detail page.

Default KPI: click-through rate.

Recommended for you

The "Recommended for you" recommendation predicts the next publication that a user is most likely to engage with, based on the viewing history of that user or similar users. This recommendation is typically used on the home page.

Default KPI: click-through rate.

Dummy

The "Dummy" recommendation returns the same results als the Publications index endpoint. The recommendation is typically used as a Zero Reference Level when starting with recommendations.

Suggest Edits

/recommendations/{id}/predict

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
posthttps://api.eu1.prepr.io//recommendations/id/predict
curl --request POST \
  --url https://api.eu1.prepr.io//recommendations/id/predict
var request = require("request");

var options = { method: 'POST',
  url:
   'https://api.eu1.prepr.io//recommendations/id/predict' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io//recommendations/id/predict")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.eu1.prepr.io//recommendations/id/predict");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io//recommendations/id/predict"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

// Results are the same as the /pubication endpoints

Path Params

id
string
required

recommendation id

 

Scopes: recommendations.

Suggest Edits

/publications/{id}/interactions

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
posthttps://api.eu1.prepr.io/publications/id/interactions
curl --request POST \
  --url https://api.eu1.prepr.io/publications/id/interactions
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.eu1.prepr.io/publications/id/interactions' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/publications/id/interactions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.eu1.prepr.io/publications/id/interactions");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/publications/id/interactions"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "code": 202,
    "message": "Accepted"
}

Body Params

label
string
value
float
person
object
 
person.id
string
person.reference_id
string

/persons (no validation, will create new person if not exists)

 

*The default value is subject to change.

Asynchronous response

The interaction is created asynchronous. The endpoint will return a status code 202 Accepted.

If a person.reference_id is posted a new Person will be created if the reference_id doesn't exists.
This is typically used when an external Identity Management System like Gigya is used.

{
	"label" : "View",
	"value" : 0.02,
	"person" : {
		"id" : "f9ac8172-b53b-4f39-b0e8-c29dd624a78c",
		"reference_id" : "9bbd76f9-6fcb-865a-5e2d-67539b7b8a04", // Optional
	}
}

Scopes: interactions_publish.
Events: person.created (if a person is created).

Suggest Edits

/interactions/labels

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/interactions/labels
curl --request GET \
  --url https://api.eu1.prepr.io/interactions/labels
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.eu1.prepr.io/interactions/labels' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/interactions/labels")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/interactions/labels");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/interactions/labels"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "items": [
        {
            "body": "Like"
        },
        {
            "body": "Bookmark"
        },
				{
            "body": "View"
        },
				{
            "body": "Dislike"
        },
				{
            "body": "Share"
        },
				{
            "body": "Purchase"
        },
				{
            "body": "Vote"
        }
    ],
    "total": 3,
    "after": "YWZ0ZXJfMjU=",
    "before": "YmVmb3JlXzA=",
    "skip": 0,
    "limit": 25
}
 

Scopes: interactions_labels.

Suggest Edits

/channels

With Prepr you can publish to all your digital channels. Publish to your website, app, live blog, social wall, social media and on location screens. All those different front ends are defined as an Channel. This description is all about the web channels.

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/channels
curl --request GET \
  --url https://api.eu1.prepr.io/channels
var request = require("request");

var options = { method: 'GET', url: 'https://api.eu1.prepr.io/channels' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/channels")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/channels");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/channels"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "items": [
        {
            "id": "81ef56b4-561f-f42e-75b5-3602fd9954ac",
            "created_on": "2018-09-12T11:36:38+00:00",
            "changed_on": "2019-02-07T09:58:50+00:00",
            "label": "Channel",
            "name": "Floortje Naar Het Einde van de Wereld",
          	"slug": "floortje-naar-het-einde-van-de-wereld
        },
        {
					// ....
        }
    ],
    "total": 2,
    "after": "YWZ0ZXJfMjU=",
    "before": "YmVmb3JlXzA=",
    "skip": 0,
    "limit": 25
}
 

Sorting channels

created_on,
-created_on,
changed_on,
-changed_on,
name,
-name

{
	"sort" : "created_on"
}

Filtering channels

Here you will find everything you need to learn how the query Prepr.

Name

Filter channels by name with equal or fuzzy search.

Supported operators: eq, fz.

{
	"name" : [
		{
			"eq" : "International",
			"fz" : "interna"
		}
	]
}

Slug

Filter channels by slug, since a slug is unique this filter will always return one result.

Supported operators: eq.

{
	"slug" : [
		{
			"eq" : "international"
		}
	]
}

Scopes: channels.

Suggest Edits

/channels

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
posthttps://api.eu1.prepr.io/channels
curl --request POST \
  --url https://api.eu1.prepr.io/channels
var request = require("request");

var options = { method: 'POST', url: 'https://api.eu1.prepr.io/channels' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/channels")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.eu1.prepr.io/channels");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/channels"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
	// Returns the same result as GET /channels/{id}
}

Body Params

name
string
required
slug
string

is unique

 
{
	"name": "Floortje naar het einde van de wereld",
	"slug": "floortje-naar-het-einde-van-de-wereld"
}

Scopes: channels, channels_publish.
Events: channel.created.

Suggest Edits

/channels/{id}

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/channels/id
curl --request GET \
  --url https://api.eu1.prepr.io/channels/id
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.eu1.prepr.io/channels/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/channels/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/channels/id");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/channels/id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
	"id": "81ef56b4-561f-f42e-75b5-3602fd9954ac",
	"created_on": "2018-09-12T11:36:38+00:00",
	"changed_on": "2019-02-07T09:58:50+00:00",
	"label": "Channel",
	"name": "Floortje Naar Het Einde van de Wereld",
	"slug": "floortje-naar-het-einde-van-de-wereld
}
{
    "code": 404,
    "message": "Not Found",
    "dbtrace": "GAE.xxxxxxxxxxxxxx"
}

Path Params

id
string
required

Query Params

fields
string
 

Scopes: channels.

Suggest Edits

/channels/{id}

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
puthttps://api.eu1.prepr.io/channels/id
curl --request PUT \
  --url https://api.eu1.prepr.io/channels/id
var request = require("request");

var options = { method: 'PUT',
  url: 'https://api.eu1.prepr.io/channels/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/channels/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.eu1.prepr.io/channels/id");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/channels/id"

response = requests.request("PUT", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
	// Returns the same result as GET /channels/{id}
}

Path Params

id
string
required
 

This endpoint is identical to POST, with the exception that name is not required.

Scopes: channels, channels_publish.
Events: channel.changed.

Suggest Edits

/channels/{id}

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
deletehttps://api.eu1.prepr.io/channels/id
curl --request DELETE \
  --url https://api.eu1.prepr.io/channels/id
var request = require("request");

var options = { method: 'DELETE',
  url: 'https://api.eu1.prepr.io/channels/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/channels/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.eu1.prepr.io/channels/id");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/channels/id"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

// empty response

Path Params

id
string
required
 

Scopes: channels, channels_delete.
Events: channel.deleted.

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io
curl --request GET \
  --url https://api.eu1.prepr.io/
var request = require("request");

var options = { method: 'GET', url: 'https://api.eu1.prepr.io/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "items": [
        {
            "id": "8431f12-27d5-4c83-9121-1d61649415",
            "created_on": "2018-09-04T12:57:01+00:00",
            "changed_on": null,
            "label": "Tag",
            "body": "Unicorn",
            "slug": "unicorn"
        },
        {
            "id": "2c98d5a3-9dca-4619-9031-6b82dc795f15",
            "created_on": "2018-09-04T12:57:01+00:00",
            "changed_on": null,
            "label": "Tag",
            "body": "Climate change",
            "slug": "climate-change"
        }
    ],
    "total": 98,
    "after": "YWZ0ZXJfMg==",
    "before": "YmVmb3JlXzA=",
    "skip": 0,
    "limit": 2
}
 

Sorting tags

id,
-id,
created_on,
-created_on,
changed_on,
-changed_on,
body,
-body

{
	"sort" : "created_on"
}

Filtering tags

Here you will find everything you need to learn how the query Prepr.

Search

Filter tags by searching in the body field with fuzzy search.

Supported operators: fz.

{
	"q" : [
		{
			"fz" : "Spor"
		}	
	]
}

Slug

Supported operators: eq.

{
	"slug" : [
		{
			"eq" : "news-and-sports"
		}
	]
}

Scopes: tags.

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
posthttps://api.eu1.prepr.io/tags
curl --request POST \
  --url https://api.eu1.prepr.io/tags
var request = require("request");

var options = { method: 'POST', url: 'https://api.eu1.prepr.io/tags' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/tags")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.eu1.prepr.io/tags");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/tags"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
	// Returns the same result as GET /publications/{id}
}

Body Params

body
string
required
slug
string

(auto generated if not set)

 

Scopes: tags, tags_publish.

Suggest Edits

/tags/{id}

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/tags/id
curl --request GET \
  --url https://api.eu1.prepr.io/tags/id
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.eu1.prepr.io/tags/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/tags/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/tags/id");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/tags/id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "id": "2c98d5a3-9dca-4619-9031-6b82dc795f15",
    "created_on": "2018-09-04T12:57:01+00:00",
    "changed_on": null,
    "label": "Tag",
    "body": "Unicorn",
    "slug": "unicorn"
}

Path Params

id
string
required
 

Scopes: tags.

Suggest Edits

/tags/{id}

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
puthttps://api.eu1.prepr.io
curl --request PUT \
  --url https://api.eu1.prepr.io/
var request = require("request");

var options = { method: 'PUT', url: 'https://api.eu1.prepr.io/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.eu1.prepr.io/");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/"

response = requests.request("PUT", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
	// Returns the same result as GET /publications/{id}
}

Path Params

id
string
required

Body Params

body
string
required
slug
string
 

This endpoint is identical to POST.

Scopes: tags, tags_publish.

Suggest Edits

/tags/{id}

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
deletehttps://api.eu1.prepr.io/tags/id
curl --request DELETE \
  --url https://api.eu1.prepr.io/tags/id
var request = require("request");

var options = { method: 'DELETE',
  url: 'https://api.eu1.prepr.io/tags/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/tags/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.eu1.prepr.io/tags/id");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/tags/id"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

// empty response

Path Params

id
string
required
 

Scopes: tags, tags_delete.

Suggest Edits

About Publication Models

 

Prepr organizes content into environments, that allows you to group all the related data for a project together, this includes publications, assets, and settings for localizing content into different languages.

Each environment has their own publication models that represents the data structure for a publication.

Suggest Edits

/publication_models

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/publication_models
curl --request GET \
  --url https://api.eu1.prepr.io/publication_models
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.eu1.prepr.io/publication_models' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/publication_models")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/publication_models");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/publication_models"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "items": [
    {
      "id": "0e91ac7f-2525-4356-816f-fd19b5283d8f",
      "created_on": "2019-01-03T10:49:24+00:00",
      "changed_on": "2019-01-03T22:03:29+00:00",
      "body": "Example",
      "description": "Example Model for StarFm",
      "label": "PublicationModel",
      "stories": true,
      "channels": true
    }
  ],
  "total": 1,
  "after": "YWZ0ZXJfMjU=",
  "before": "YmVmb3JlXzA=",
  "skip": 0,
  "limit": 25
}
 

Fields: fields, title.
Scopes: publication_models.

Suggest Edits

/publication_models/{id}

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/publication_models/id
curl --request GET \
  --url https://api.eu1.prepr.io/publication_models/id
var request = require("request");

var options = { method: 'GET',
  url:
   'https://api.eu1.prepr.io/publication_models/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/publication_models/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/publication_models/id");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/publication_models/id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
	"id": "0e91ac7f-2525-4356-816f-fd19b5283d8f",
	"created_on": "2019-01-03T10:49:24+00:00",
	"changed_on": "2019-01-03T22:03:29+00:00",
	"body": "Example",
	"description": "Example Model for StarFm",
	"label": "PublicationModel",
	"stories": true,
	"channels": true
}

Path Params

id
string
required

Query Params

fields
string
 

Fields: fields, title.
Scopes: publication_models.

Suggest Edits

Uploading Audios

 

To upload audios send a request to post /assets endpoint and set label to Audio and add source (multipart/form-data).

{
	"label": "Audio",
	"source": // File Upload.
}

You can include the fields param in this request (How to use fields).

The endpoint will return a http status 201 OK with the asset response.

{
    "id": "16012a23-3130-43e2-96df-4438ed4097fc",
    "created_on": "2019-10-02T13:00:00+00:00",
    "changed_on": "2019-10-02T13:00:00+00:00",
    "label": "Audio",
    "name": "Hello World",
    "body": null,
    "author": null,
    "reference_id": null
}

Scopes: assets, assets_publish.
Events: asset.created.

Suggest Edits

Uploading Photos

 

To upload photos send a request to post /assets endpoint and set label to Photo and add source (multipart/form-data).

{
	"label": "Photo",
	"source": // File Upload.
}

You can include the fields param in this request (How to use fields).

The endpoint will return a http status 201 OK with the asset response.

{
    "id": "16012a23-3130-43e2-96df-4438ed4097fc",
    "created_on": "2019-10-02T13:00:00+00:00",
    "changed_on": "2019-10-02T13:00:00+00:00",
    "label": "Photo",
    "name": "IMG_1234",
    "body": null,
    "author": null,
    "reference_id": null
}

Scopes: assets, assets_publish.
Events: asset.created.

Suggest Edits

Uploading Videos

 

Upload videos as chunks, handle errors, and resume the upload of any remaining chunks. There are three different upload phases:

1. Start - Initialize an upload session

Start a resumable upload by initializing a new asset object. To make a start request and create a video upload session, send a request to post /assets (Assets) endpoint, set the upload_phase field to start, and specify file_size, in bytes.

{
	"label": "Video",
	"upload_phase": "start",
	"file_size": "8308859"
}

2. Transfer - Upload video chunks

Once you have chunks ready to upload with the right start_offset and end_offset you can make a transfer request to upload the chunk, and get the offset for the next chunk.

Split the video with the UNIX command split -b{X}m {filename}. This command splits your file into multiple parts of X MB each.

To upload the first video chunk, send a request to the post /assets/{id}/multipart endpoint and set the upload_phase field to transfer and add video_file_chunk (multipart/form-data).

The default chunk size is 52428800 bytes.

{
	"upload_phase": "transfer",
	"original_name": "1c5b89d9-b6cc-4962-90c8-766769a478aa_1080.mp4",
	"video_file_chunk": // File Upload Chunk.
}

Repeat this step for every chunk. As a final step, you need to post this video and close the upload session.

3. Finish - Post the video

Once you upload all chunks, make a finish request to complete the upload, post the video, and queue it for asynchronous video-encoding.

Make a request to post /assets/{id}/multipart endpoint with the param upload_phase set to finish.

You can include the fields param in this request (How to use fields).

{
	"upload_phase": "finish"
}

The endpoint will return a http status 200 OK with the asset response.

{
	"id": "69cbd289-0f0c-4a15-80a-c60d376db5f8",
	"created_on": "2019-09-09T13:54:03+00:00",
	"changed_on": "2019-09-09T13:54:03+00:00",
	"label": "Video",
	"name": "1c5b89d9-b6cc-4962-90c8-766769a478aa_1080",
	"body": null,
	"author": null
}

Scopes: assets, assets_publish.
Events: asset.created.

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
posthttps://api.eu1.prepr.io/assets
curl --request POST \
  --url https://api.eu1.prepr.io/assets
var request = require("request");

var options = { method: 'POST', url: 'https://api.eu1.prepr.io/assets' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/assets")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.eu1.prepr.io/assets");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/assets"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "id": "12dd8e-67f5-4ae1-a6de-add3472e29",
    "created_on": "2019-07-31T14:58:07+00:00",
    "changed_on": "2019-09-09T13:40:36+00:00",
    "label": "Photo",
    "name": "66420445_4397356630205_56986744104089136_n.jpg",
    "body": null,
    "author": null,
    "reference_id": null,
    "cdn_files": {
        "total": 1,
        "items": [
            {
                "id": "5b42a6a6-3f2d-4261-9aeb-b1ced2fc3f03",
                "created_on": "2019-07-31T14:58:07+00:00",
                "changed_on": null,
                "label": "CdnFile",
                "cdn": "AWS",
                "bucket": null,
                "profile": "jpg",
                "file": "0d6d6a11-4b12-4959-b6c9-d156aa2b9619.jpg",
                "url": "https://dhsgdhgsjdff.cloudfront.net/{format}/s3-client-name/0d6d6a11-4b12-4959-b6c9-d156aa2b9619.jpg"
            }
        ]
    }
}

Body Params

label
string
required

One of: Photo, Document, Audio, Video

source
file
required

required with Audio, Photo, Document

name
string
body
string
author
string
file_size
int32

See Video Chunk Upload docs guide

video_file_chunk
string

See Video Chunk Upload docs guide

upload_phase
string

See Video Chunk Upload docs guide

 

Assets uploaded earlier will not upload again. Instead the earlier version will be returned. New added metadata like name, body, author will not be overwritten.

Fields: cdn_files, storage_file, tags.

Scopes: assets_publish.

Suggest Edits

/assets/{id}

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/assets/id
curl --request GET \
  --url https://api.eu1.prepr.io/assets/id
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.eu1.prepr.io/assets/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/assets/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/assets/id");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/assets/id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "id": "12d04d8e-67f5-4ae1-a6de-add34e29",
  "created_on": "2019-07-31T14:58:07+00:00",
  "changed_on": "2019-09-09T13:40:36+00:00",
  "label": "Photo",
  "name": "66420445_439697356630205_5698662744104089136_n",
  "body": null,
  "author": null,
  "cdn_files": {
    "total": 1,
    "items": [
      {
        "id": "5b42a6a6-3d-4261-9aeb-b1ced2fc3f03",
        "created_on": "2019-07-31T14:58:07+00:00",
        "changed_on": null,
        "label": "CdnFile",
        "cdn": "AWS",
        "bucket": null,
        "profile": "jpg",
        "file": "0d6d6a11-4b12-4959-b6c9-d156aa2b9619.jpg",
        "url": "https://d2f82pyqgu2mif.cloudfront.net/{format}/s3-client-bucket/0d6d6a11-4b12-4959-b6c9-d156ab9619.jpg",
        "resized": {
        "thumb": "https://d2f82pyqgu2mif.cloudfront.net/w_1920/s3-client-bucket/0d6d6a11-4b12-4959-b6c9-d1562b9619.jpg"
      }
    }
    ]
  }
}
{
    "code": 404,
    "message": "Not Found",
    "dbtrace": "GAE.xxxxxxxxxxxxxx"
}

Path Params

id
string
required
 

Fields: cdn_files, storage_file, tags.

Scopes: assets.

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/persons
curl --request GET \
  --url https://api.eu1.prepr.io/persons
var request = require("request");

var options = { method: 'GET', url: 'https://api.eu1.prepr.io/persons' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/persons")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/persons");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/persons"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
	"items": [
		{
			"id": "b86aa4d2-9dd5-4b30-911f-6e68ac6d9ceb",
			"created_on": "2019-02-15T16:39:09+00:00",
			"changed_on": "2019-02-15T16:39:09+00:00",
			"last_seen": "2019-02-15T16:39:09+00:00",
			"label": "Person",
			"initials": "",
			"first_name": "",
			"last_name": "",
			"nickname": null,
			"exclude_until": null,
			"source": null
		},
		{
			// ....
		}
	],
	"total": 2,
	"after": "YWZ0ZXJfMjU=",
	"before": "YmVmb3JlXzA=",
	"skip": 0,
	"limit": 25
}

Query Params

fields
string
limit
int32

min: 1, max: 500

skip
int32

min: 0

sort
string

in:created_on,-created_on,changed_on,-changed_on,last_name,-last_name,first_name,-first_name

q
string
created_on
array
last_seen
array
gender
array
age
array
liked
array
viewed
array
shared
array
bookmarked
array
commented
array
won
array
called
array
emailed
array
purchased
array
facebook_accounts
array
twitter_accounts
array
instagram_accounts
array
google_accounts
array
spotify_accounts
array
stripe_customer
array
password
array
tags
array
terms
array
 

Filtering persons

Here you will find everything you need to learn how the query Prepr.

Gender

Supported operators: eq, neq, in.

{
	"gender" : [
		{
			"eq" : "male",
			"neq" : "female",
			"in" : ["male", "female"]
		}	
	]
}

Age

Supported operators: eq, lt, gt.

{
	"age" : [
		{
			"eq" : "18",
			"lt" : "19",
			"lte" : "18",
			"gt" : "21",
			"gte" : "20"
		}	
	]
}

Interactions

Supported operators: eq, in, has.

{
	"interactions" : [
		{
			"eq" : "120c2b8a-73f4-b43c-1b3c-b7513288f740",
			"in" : [
				"120c2b8a-73f4-b43c-1b3c-b7513288f740",
				"16d388e4-c8b9-e870-d446-d3f0fd4b3cdf"
			],
			"has" : true, // false
			"type" : "Purchased"
		}	
	]
}

Created & Last Seen

The date filter can be used with the operators eq, lt, gt, li and accepts UTC timestamps.

{
	"created_on" : [
		{
			"eq" : "2019-01-08T14:10:58+00:00",
			"lt" : "2019-01-08T14:10:58+00:00",
			"lte" : "2019-01-08T14:10:58+00:00",
			"gt" : "2019-01-08T14:10:58+00:00",
			"gte" : "2019-01-08T14:10:58+00:00",
			"il" : "2019-01-08T14:10:58+00:00"
		}	
	],
	"last_seen" : [
		{
			"eq" : "2019-01-08T14:10:58+00:00",
			"lt" : "2019-01-08T14:10:58+00:00",
			"lte" : "2019-01-08T14:10:58+00:00",
			"gt" : "2019-01-08T14:10:58+00:00",
			"gte" : "2019-01-08T14:10:58+00:00",
			"il" : "2019-01-08T14:10:58+00:00"
		}	
	]
}

Examples

Filter to fetch all persons created in the last week, older than or 18 and purchased product X.

{
	"created_on" : [
		{
			"il" : 604800
		}	
	],
	"age" : [
		{
			"gte" : 18
		}	
	],
	"interactions" : [
		{
			"eq" : "4237f1d9-ad15-2a8a-1951-d8625c8d67c0",
			"type" : "Purchased"
		}	
  ],
}

Scopes: persons.

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
posthttps://api.eu1.prepr.io/persons
curl --request POST \
  --url https://api.eu1.prepr.io/persons
var request = require("request");

var options = { method: 'POST', url: 'https://api.eu1.prepr.io/persons' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/persons")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.eu1.prepr.io/persons");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/persons"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

Try the API to see results

Body Params

first_name
string
last_name
string
nickname
string
gender
string

in:male,female,other

date_of_birth
string

date_format:Y-m-d

source
string
emails
array
phones
array
addresses
array
logged_in_from
array
custom
array of strings
reference_id
string
company
string
job_title
string
created_on
string
last_seen
string
exclude_until
string
tags
array
password
string
two_factor_code
string
sessions
array
bank_accounts
array
terms
array of objects
id
source
profile_photo
file
 

Scopes: persons, persons_publish

Suggest Edits

/persons/{id}

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
puthttps://api.eu1.prepr.io/persons/id
curl --request PUT \
  --url https://api.eu1.prepr.io/persons/id
var request = require("request");

var options = { method: 'PUT',
  url: 'https://api.eu1.prepr.io/persons/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/persons/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.eu1.prepr.io/persons/id");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/persons/id"

response = requests.request("PUT", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

Try the API to see results

Path Params

id
string
required

Body Params

first_name
string
last_name
string
nickname
string
gender
string

in:male,female,other

date_of_birth
string

date_format:Y-m-d

source
string
emails
array
phones
array
addresses
array
logged_in_from
array
custom
array of strings
reference_id
string
company
string
job_title
string
created_on
string
last_seen
string
exclude_until
string
tags
array
password
string
two_factor_code
string
sessions
array
bank_accounts
array
terms
array of objects
id
source
profile_photo
file
 

Scopes: persons, persons_publish

Suggest Edits

/persons/{id}

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/persons/id
curl --request GET \
  --url https://api.eu1.prepr.io/persons/id
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.eu1.prepr.io/persons/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/persons/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/persons/id");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/persons/id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

Try the API to see results

Path Params

id
string
required
 

Scopes: persons

Suggest Edits

/persons/{id}/anonymize

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
puthttps://api.eu1.prepr.io/persons/id/anonymize
curl --request PUT \
  --url https://api.eu1.prepr.io/persons/id/anonymize
var request = require("request");

var options = { method: 'PUT',
  url:
   'https://api.eu1.prepr.io/persons/id/anonymize' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/persons/id/anonymize")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.eu1.prepr.io/persons/id/anonymize");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/persons/id/anonymize"

response = requests.request("PUT", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

Try the API to see results

Path Params

id
string
required
 

Scopes: persons, persons_delete

Not revertible

If this endpoint is triggered no confirmation will be asked. And this endpoint will remove all personal data that's covered by GDPR and the id will be replaced with a new one.

Exception:
Interactions will be connect to the anonymized person.

Suggest Edits

/persons/{id}

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
deletehttps://api.eu1.prepr.io/persons/id
curl --request DELETE \
  --url https://api.eu1.prepr.io/persons/id
var request = require("request");

var options = { method: 'DELETE',
  url: 'https://api.eu1.prepr.io/persons/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/persons/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.eu1.prepr.io/persons/id");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/persons/id"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

Try the API to see results

Path Params

id
string
required
 

Scopes: persons, persons_delete

Not revertible

If this endpoint is triggered no confirmation will be asked. And this endpoint will fully remove all personal data that's covered by GDPR (including interactions).

Suggest Edits

/segments

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/segments
curl --request GET \
  --url https://api.eu1.prepr.io/segments
var request = require("request");

var options = { method: 'GET', url: 'https://api.eu1.prepr.io/segments' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/segments")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/segments");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/segments"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "items": [
        {
            "id": "93fb1b38-9a85-4d6e-9639-8c4a8a88454a",
            "created_on": "2019-01-14T19:52:58+00:00",
            "changed_on": null,
            "label": "Publication",
            "slug": {
                "en-EN": "publication-model-two-21"
            },
            "publish_on": {
                "en-EN": "2019-01-11T13:24:34+00:00"
            },
            "status": {
                "en-EN": {
                    "id": "7f18224a-437b-4421-a7ce-6551d177c53e",
                    "created_on": "2018-12-24T09:09:25+00:00",
                    "changed_on": null,
                    "label": "Status",
                    "body": "Done"
                }
            }
        },
        {
					// ....
        }
    ],
    "total": 2,
    "after": "YWZ0ZXJfMjU=",
    "before": "YmVmb3JlXzA=",
    "skip": 0,
    "limit": 25
}
 

Sorting persons

created_on,
-created_on,
changed_on,
-changed_on,
last_seen,
-last_seen

{
	"sort" : "created_on"
}

Filtering persons

Here you will find everything you need to learn how the query Prepr.

Registration Date & Last seen

The date filter can be used with the operators eq, lt, lte, gt, gte, il and accepts UTC timestamps (except the il operator).

{
	"created_on" : [
		{
			"eq" : "2019-01-08T14:10:58+00:00",
			"lt" : "2019-01-08T14:10:58+00:00",
			"gt" : "2019-01-08T14:10:58+00:00",
      "il" : 3600
		}	
	],
	"last_seen" : [
		{
			"eq" : "2019-01-08T14:10:58+00:00",
			"lt" : "2019-01-08T14:10:58+00:00",
			"gt" : "2019-01-08T14:10:58+00:00",
      "il" : 3600
		}
	]
}

Scopes: persons.

Suggest Edits

/segments

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
posthttps://api.eu1.prepr.io/segments
curl --request POST \
  --url https://api.eu1.prepr.io/segments
var request = require("request");

var options = { method: 'POST', url: 'https://api.eu1.prepr.io/segments' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/segments")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.eu1.prepr.io/segments");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/segments"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
	"body" : "Test segment",
	"rules" : {
		"items" : {
			// contains filter items like /persons filters
		}
	}
}

Body Params

body
string
required
rules
object
 
rules.items
object
 
rules.items.*
object
 
 

Scopes: segments.

Suggest Edits

/messages

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/messages
curl --request GET \
  --url 'https://api.eu1.prepr.io/messages?created_on=created_on'
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.eu1.prepr.io/messages',
  qs: { created_on: 'created_on' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/messages?created_on=created_on")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/messages?created_on=created_on");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/messages"

querystring = {"created_on":"created_on"}

response = requests.request("GET", url, params=querystring)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "items": [
        {
            "id": "3869295d-c4a3-b21c-4dc7-2dbb8fdca824",
            "created_on": "2019-02-27T14:47:21+00:00",
            "changed_on": null,
            "label": "Message",
            "body": "Goede middag Coen, ik luister echt elke dag wat een top show!",
            "sent": {
                "id": "b9233864-6c77-81bc-e5d2-bb2628ee9f03",
                "created_on": "2019-02-26T15:29:22+00:00",
                "changed_on": null,
                "last_seen": "2019-02-26T15:29:22+00:00",
                "label": "Person",
                "initials": "",
                "first_name": "Mark",
                "last_name": "",
                "nickname": "Forster",
                "exclude_until": null,
                "source": null,
                "phones": {
                    "total": 1,
                    "items": [
                        {
                            "id": "e796a103-59c4-7ef8-7938-7d4ac7f2906e",
                            "created_on": "2019-02-26T15:29:22+00:00",
                            "changed_on": null,
                            "label": "Phone",
                            "phone": "31612345678"
                        }
                    ]
                }
            }
        },
        {
					// ....
        }
    ],
    "total": 2,
    "after": "YWZ0ZXJfMjU=",
    "before": "YmVmb3JlXzA=",
    "skip": 0,
    "limit": 25
}

Query Params

created_on
array
required
 

Filtering messages

Here you will find everything you need to learn how the query Prepr.

Created on (required filter)

Filter the messages on the created on date. Accepts UTC timestamps.

{
	"created_on" : [
		{
			"gt" : "1551017519",
			"lt" : "1551276731"
		}
	]
}

Channels

{
	"channels" : [
		{
			"eq" : "bcc9eea7-7307-f45b-5aaf-27eca7d329f9",
			"in" : [
				"222b7528-9e3a-294f-21bf-7ec623d1ac74",
				"bcc9eea7-7307-f45b-5aaf-27eca7d329f9"
			]
		}
	]
}

Moods

Filter messages by the mood (tag) of the person who sended the message.

{
  	"moods" : [
		{
			"in" : ["2c07bbf4-028c-82da-7c80-6217f97d3129"] // Support `tag` Id's.
		}	
	]
]

Favorites

Messages favorited by the logged in user. requires a valid session

{
  	"favorites" : [
		{
			"has" : true
		}	
	]
]

On screen

Messages on screen.

{
  	"on_screen" : [
		{
			"has" : true
		}	
	]
]

Assets

Filter messages that contain assets (photo, audio or videos).

{
	"assets" : [
		{
			"in" : ["photo", "audio", "video"]
		}
	]
}

Search

Filter messages by searching in the body field, name and phone number with fuzzy search.

Supported operators: fz.

{
	"q" : [
		{
			"fz" : "donald j"
		}	
	]
}

Scopes: messages.

Suggest Edits

/configurations

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/configurations
curl --request GET \
  --url https://api.eu1.prepr.io/configurations
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.eu1.prepr.io/configurations' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/configurations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/configurations");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/configurations"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "id": "6232c647-1110-4354-eb5t-d4476e8d48bb",
  "created_on": "2018-05-11T08:08:52+00:00",
  "changed_on": "2018-05-11T08:08:52+00:00",
  "label": "Configuration",
  "body": "Landing page - hero videoplayer"
    
  //optional field `settings`:
  "settings": null,
  
  //or
  
  "settings": {
    "key": "value",
  }
}

Query Params

q
string
 

Scopes: configurations

Suggest Edits

/configurations

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
posthttps://api.eu1.prepr.io/configurations
curl --request POST \
  --url https://api.eu1.prepr.io/configurations
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.eu1.prepr.io/configurations' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/configurations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.eu1.prepr.io/configurations");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/configurations"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "id": "6232c647-1110-4354-eb5t-d4476e8d48bb",
  "created_on": "2018-05-11T08:08:52+00:00",
  "changed_on": "2018-05-11T08:08:52+00:00",
  "label": "Configuration",
  "body": "Landing page - hero videoplayer"
  "settings": {
    "key": "value",
  }
}

Body Params

body
string
required
settings
array of strings
 

Scopes: configurations, configurations_publish

Suggest Edits

/configurations/{id}

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/configurations/id
curl --request GET \
  --url https://api.eu1.prepr.io/configurations/id
var request = require("request");

var options = { method: 'GET',
  url:
   'https://api.eu1.prepr.io/configurations/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/configurations/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/configurations/id");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/configurations/id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "id": "6232c647-1110-4354-eb5t-d4476e8d48bb",
  "created_on": "2018-05-11T08:08:52+00:00",
  "changed_on": "2018-05-11T08:08:52+00:00",
  "label": "Configuration",
  "body": "Landing page - hero videoplayer"
    
  //optional field `settings`:
  "settings": null,
  
  //or
  
  "settings": {
    "key": "value",
  }
}

Path Params

id
string
required
 

Scopes: configurations

Suggest Edits

/configurations/body/{body}

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/configurations/body/body
curl --request GET \
  --url https://api.eu1.prepr.io/configurations/body/body
var request = require("request");

var options = { method: 'GET',
  url:
   'https://api.eu1.prepr.io/configurations/body/body' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/configurations/body/body")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/configurations/body/body");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/configurations/body/body"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "id": "6232c647-1110-4354-eb5t-d4476e8d48bb",
  "created_on": "2018-05-11T08:08:52+00:00",
  "changed_on": "2018-05-11T08:08:52+00:00",
  "label": "Configuration",
  "body": "Landing page - hero videoplayer"
    
  //optional field `settings`:
  "settings": null,
  
  //or
  
  "settings": {
    "key": "value",
  }
}

Path Params

body
string
required
 

Scopes: configurations

Suggest Edits

/configurations/{id}

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
puthttps://api.eu1.prepr.io/configurations/id
curl --request PUT \
  --url https://api.eu1.prepr.io/configurations/id
var request = require("request");

var options = { method: 'PUT',
  url:
   'https://api.eu1.prepr.io/configurations/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/configurations/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.eu1.prepr.io/configurations/id");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/configurations/id"

response = requests.request("PUT", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
  "id": "6232c647-1110-4354-eb5t-d4476e8d48bb",
  "created_on": "2018-05-11T08:08:52+00:00",
  "changed_on": "2018-05-11T08:08:52+00:00",
  "label": "Configuration",
  "body": "Landing page - hero videoplayer"
    
  //optional field `settings`:
  "settings": null,
  
  //or
  
  "settings": {
    "key": "value",
  }
}

Path Params

id
string
required

Body Params

body
string
settings
array of strings
 

Scopes: configurations, configurations_publish

Remove setting key

To remove a setting key you have to send settings[yourkey] = null

Suggest Edits

/configurations/{id}

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
deletehttps://api.eu1.prepr.io/configurations/id
curl --request DELETE \
  --url https://api.eu1.prepr.io/configurations/id
var request = require("request");

var options = { method: 'DELETE',
  url:
   'https://api.eu1.prepr.io/configurations/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/configurations/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.eu1.prepr.io/configurations/id");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/configurations/id"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

Try the API to see results

Path Params

id
string
required
 

Scopes: configurations, configurations_delete

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/health
curl --request GET \
  --url https://api.eu1.prepr.io/health
var request = require("request");

var options = { method: 'GET', url: 'https://api.eu1.prepr.io/health' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/health")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/health");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/health"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "message": "I'm okay buddy, fine and stable."
}
{
    "message": "Service Unavailable"
}
 

Returns 200 OK when all services are up.
Returns 503 Service Unavailable when down or has degraded performance.

Suggest Edits

/publications/bulk/webhooks

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://api.eu1.prepr.io/publications/bulk/webhooks
curl --request GET \
  --url https://api.eu1.prepr.io/publications/bulk/webhooks
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.eu1.prepr.io/publications/bulk/webhooks' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.eu1.prepr.io/publications/bulk/webhooks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.eu1.prepr.io/publications/bulk/webhooks");

xhr.send(data);
import requests

url = "https://api.eu1.prepr.io/publications/bulk/webhooks"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "webhooks": {
        "0336be22-2b1e-a91a-a259-d805c38190d3": [
            "https://yourwebhookurlone.io/callback",
            "https://yourwebhookurltwo.io/callback",
            "https://yourwebhookurlthree.io/callback",
        ],
        "0336be22-2b1e-a91a-a259-d805c38190d3": [
          ...
        ]
    }
}

Body Params

event
string
required

In: publication.created, publication.changed, publication.published

 

Uses the same filters as GET /publications (list/index)

You can use the same filters as GET /publications (list/index) here above. All publications that matches your criteria, get a webhook trigger with your defined event.

Delay

Remember that the trigger webhooks are in the queue. And that the number of webhooks can increase rapidly, due to the number of webhooks that have been set up and the number of publications that meet your criteria.

Example calculation:

  • 3 webhooks that are listening to the event publication.published
  • 1,000 publications that meet with the criteria.

Will result in (3 webhooks x 1,000 publications) = 3,000 webhooks triggered.

Be patient ❤️

Scopes: publications.

Suggest Edits

/publications/bulk/put

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
puthttps://api.eu1.prepr.io/publications/bulk/put
{
    "index": {
        "locales": [
            {
                "eq": "nl-NL"
            }
        ]
    },
    "put": {
        "locales": [
            "nl-NL"
        ],
        "status": {
            "nl-NL": {
                "body": "Done"
            }
        },
        "assigned_to": {
            "nl-NL": {
                "id": "00deeffb-1f41-49be-b600-206f7326e600"
            }
        }
    }
}
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "items": {
        "srf0edb6-329a-4b5e-b9ce-09f2d9d31000": 200,
        "srf0edb6-329a-4b5e-b9ce-09f2d9d31001": 404,
        "srf0edb6-329a-4b5e-b9ce-09f2d9d31002": 200
    },
    "total": 3,   // total items in this request tried to update
    "updated": {
        "200": 2, // Successful updated
        "404": 1  // Unsuccessful updated
    }
}

Body Params

index
object

Params for GET /publications endpoint

 
put
object

Params for PUT /publications endpoint

 
 

No rollback!

Note that this bulk endpoint doesn't any backup, so make sure what you are doing.

Uses the same filters as GET /publications (list/index)

You can use the same filters as GET /publications (list/index) here above. All publications that matches your criteria, will be updated.

Uses the same params and validators as PUT /publications

Bulk endpoint uses the same endpoint as PUT /publications. the params and validators of that endpoint may apply.

Scopes: publications, publications_publish, publications_bulk.

Suggest Edits

/publications/bulk/delete

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
deletehttps://api.eu1.prepr.io/publications/bulk/delete
{
    "index": {
        "locales": [
            {
                "eq": "nl-NL"
            }
        ]
    },
}
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "items": {
        "srf0edb6-329a-4b5e-b9ce-09f2d9d31000": 204,
        "srf0edb6-329a-4b5e-b9ce-09f2d9d31001": 400,
        "srf0edb6-329a-4b5e-b9ce-09f2d9d31002": 204
    },
    "total": 3,   // total items in this request tried to delete
    "updated": {
        "204": 2, // Successful deleted
        "400": 1  // Unsuccessful deleted
    }
}

Body Params

index
object

Params for GET /publications endpoint

 
 

No rollback!

Note that this bulk endpoint doesn't any backup, so make sure what you are doing.

Uses the same filters as GET /publications (list/index)

You can use the same filters as GET /publications (list/index) here above. All publications that matches your criteria, will be updated.

Scopes: publications, publications_delete, publications_bulk.