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" : 1546304461, // Optimized
			"lt" : 1546304461, // Optimized (if used with gt)
			"gt" : 1546304461,
		}	
	],
	"changed_on" : [
		{
			"eq" : 1546304461, // Optimized
			"lt" : 1546304461, // Optimized (if used with gt)
			"gt" : 1546304461,
		}	
	],
	"publish_on" : [
		{
			"eq" : 1546304461, // Optimized
			"lt" : 1546304461, // Optimized (if used with gt)
			"gt" : 1546304461,
		}	
	],
	"expire_on" : [
		{
			"eq" : 1546304461, // Comming Soon
			"lt" : 1546304461, // Comming Soon
			"gt" : 1546304461, // Comming 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.

All fields that are available on /publications can be found in the /publications/{id} reference.

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, published, model, locales, status, environment, created_by, updated_by, assigned_to, insights, channels, containers, internal_comments.
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"
}
 

Single:

"{{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
}

Multiple:

"{{api_id}}": {
	"items": [
      {
        // element 1
        "body" : "2020-01-01",
				"label" : "DateTime", // Required inside the Drag-and-drop editor
				"format" : "Y-m-d" // Required inside the Drag-and-drop editor
      },
      {
        // element 2
        "label": "DateTime",
        "value": "2020-01-02 00:00:00",
        "format": "Y-m-d H:i:s"
      }
	],
  "label" : "DateTime"
}
Suggest Edits

DateTimeRange

 

Single:

"{{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"
}

Multiple:

"{{api_id}}": {
  "items": [
    {
      // element 1
      "label": "DateTimeRange",
      "from": "2020-01-01 00:00:00",
      "until": "2020-01-01 00:00:00",
      "format": "Y-m-d H:i:s"
    },
    {
      // element 2
      "label": "DateTimeRange",
      "from": "2020-01-02 00:00:00",
      "until": "2020-01-02 00:00:00",
      "format": "Y-m-d H:i:s"
    },
  ],
  "label": "DateTimeRange"
}
 
"{{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": "a734jad-32478623-sdafw4f4jgfj4",
	"created_on": "2019-01-09T20:29:28+00:00",
	"changed_on": null,
	"label": "QualifioPost"
},
"{{api_id}}" : {
	"id" : "87654321",
	"label" : "QualifioPost" // Required inside the Drag-and-drop editor
}
Suggest Edits

BusinessHours

 

The BusinessHours field type can hold multiple entries per day. Enter valid_from and valid_until params for entries that contain an irregular schedule.

{
   "items":{
      "en-US":{
         "{{api_id}}":{
            "items":[
               {
                  "id":"0920c90a-6139-4116-baf4-2b8de6f7ccc2",
                  "created_on":"2020-02-04T04:39:05+00:00",
                  "changed_on":null,
                  "label":"BusinessHours",
                  "open_day":3,
                  "open_time":"00:00",
                  "close_day":4,
                  "close_time":"00:00",
                  "valid_from":null,
                  "valid_until":null
               },
               {
                  "id":"52b71d20-d3d8-4711-b6f9-a9a0280e417f",
                  "created_on":"2020-02-04T04:39:06+00:00",
                  "changed_on":null,
                  "label":"BusinessHours",
                  "open_day":3,
                  "open_time":"03:00",
                  "close_day":3,
                  "close_time":"04:00",
                  "valid_from":"2020-01-02",
                  "valid_until":"2020-01-03"
               }
            ],
            "label":"BusinessHours"
         }
      }
   }
}
"{{api_id}}" : {
	"items" : [
			{
				"open_day" : 2,
				"open_time" : "08:00",
				"close_day" : 2,
				"close_time" : "19:00",
				"valid_from" : "2020-03-09",
				"valid_until" : "2020-03-12"
			}
		]
	}
}
field
allowed value

open_day

1-7

required

open_time

00:00 to 23:59

required

close_day

1-7

required

close_time

00:00 to 23:59

required

valid_from

YYYY-MM-DD

valid_until

YYYY-MM-DD

Suggest Edits

Publications (reference)

 

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 (reference)

 

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 (reference)

 

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 (reference)

 

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

Getting Started

 

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

Recommendation recipe

When you start using recommendations, you work with our staff to determine the best recommendation recipe 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.

You can use the recommendations in a variety of scenarios, such as giving users recommendations based on their behavior, likes, bookmarks and subscribes.

Available recommendation recipes

Prepr offers the following recommendation recipes:

personalized-sims-metadata (personalized)

The Personalized-Sims-Metadata recipe generates personalized ranking. A personalized ranking is a list of recommended publications that are re-ranked for a specific user. This recipe has the following properties:

Interaction label set the interaction label where the recommendation is based on available options: bookmark, subscribed.

Similar Tag Factor set the weight factor for the recommendations based on similar tags.

Popularity Factor Affects the balance between popularity and meta-data similarity. A value of 1 makes the most popular publication appear as recommendations regardless of their correlation. A value of 0 makes most publications that have co-interactions (shared meta-data) with the specific publication appear as recommendations regardless of their popularity. For most cases, a value around 0.3 works best.

Requires: person.id.

sims (related)

The (SIMS) Item-to-item similarities recipe is based on the concept of collaborative filtering. A SIMS model leverages user-item interaction data to recommend publications similar to a given publication. In the absence of sufficient user interaction data for an publication, this recipe recommends popular publications that share the similar tags. This recipe has the following properties:

Similar Tag Factor set the weight factor for the recommendations based on similar tags.

Popularity Factor Affects the balance between popularity and meta-data similarity. A value of 1 makes the most popular publication appear as recommendations regardless of their correlation. A value of 0 makes most publications that have co-interactions (shared meta-data) with the user interacted publications appear as recommendations regardless of their popularity. For most cases, a value around 0.3 works best.

Requires: publication.id.

sims-metadata (related)

The (SIMS-metadata) Item-to-item similarities recipe is based on the concept of content based filtering. A SIMS-metadata model leverages the publications metadata to recommend publications similar to a given publication. Automatic tagging (topics) can be used as an extra factor next to similar tags. This recipe has the following properties:

Similar Tag Factor set the weight factor for the recommendations based on similar tags.

Topic Factor set the weight factor for the recommendations based on similar topics (auto tagging).

Similar tags or topics can also be used separately.

Requires: publication.id.

popularity-count

Popularity-count returns the top popular publications. A popular publication is defined by the number of times has been viewed. Popularity-count is a good starting point to compare against other recipes. This recipe has the following properties:

Random factor an optional weight that can be set in the absence of sufficient user interaction data.

popularity-count-location (location based/related)

Popularity-count-location returns the top popular publications nearby. A popular publication is defined by the number of times has been viewed. Publications that are popular by visitors viewing the scoped publication are boosted. This recipe has the following properties:

25 percentile factor set a boost factor for publications closer the the 25 percentile distance to the scoped publication.

70 percentile factor set a boost factor for publications closer the the 70 percentile distance to the scoped publication.

distance sets the max. radius of the distance to the scoped publication.

Requires: publication.id.

randomized-trials

Randomized trials returns randomly selected publications. The Randomized trials recipe is often used as a starting point to compare against other recipes.

Getting Recommendations

Check out the /recommendations/{id}/predict endpoint to see how to get the 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

 

All fields and most filters supported on the Publications endpoint are available.

Scopes: recommendations.

Suggest Edits

Getting Started

 

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 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

 

OAuth2 Auth

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

var options = { method: 'POST',
  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::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/publication_models");

xhr.send(data);
import requests

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

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

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "id": "a8a1ec2nc-7e49-458f-8adf-35ae7f8b2a8e",
    "created_on": "2020-02-18T10:00:00+00:00",
    "changed_on": "2020-02-18T10:00:00+00:00",
    "body": "News Article",
    "description": null,
    "label": "PublicationModel",
    "status": "published",
    "stories": true,
    "timelines": false,
    "allow_stories": true,
    "channels": true,
    "allow_channels": true,
    "container_required": false,
    "channels_required": false,
    "slug": null,
    "for": null
}
// Example bad request, errors can may be different
{
    "code": 400,
    "message": "Bad Request",
    "errors": {
        "body": [
            "validator.error.body.required"
        ],
        "stories": [
            "validator.error.stories.required"
        ],
        "channels": [
            "validator.error.channels.required"
        ]
    },
    "dbtrace": "GAE.1582021386.5349"
}

Body Params

body
string
required
description
string
stories
boolean
required
stories_required
boolean
timelines
boolean
channels
boolean
required

If true, it's possible to place publications based on this model in channels that are listed in can_publish_in.

channels_required
boolean
production_url
string
preview_url
string
slug
string
can_publish_in
array of strings

Should contain channel ids where this type of publication can be published in.

 

Scope: publication_models, publication_models_publish

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

/publication_models/{id}

 

OAuth2 Auth

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

var options = { method: 'PUT',
  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::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/publication_models/id");

xhr.send(data);
import requests

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

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

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "id": "a8a1ec2nc-7e49-458f-8adf-35ae7f8b2a8e",
    "created_on": "2020-02-18T10:00:00+00:00",
    "changed_on": "2020-02-18T10:00:00+00:00",
    "body": "News Article",
    "description": null,
    "label": "PublicationModel",
    "status": "published",
    "stories": true,
    "timelines": false,
    "allow_stories": true,
    "channels": true,
    "allow_channels": true,
    "container_required": false,
    "channels_required": false,
    "slug": null,
    "for": null
}
// Example bad request, errors can may be different
{
    "code": 400,
    "message": "Bad Request",
    "errors": {
        "body": [
            "validator.error.body.required"
        ],
        "stories": [
            "validator.error.stories.required"
        ],
        "channels": [
            "validator.error.channels.required"
        ]
    },
    "dbtrace": "GAE.1582021386.5349"
}

Path Params

id
string
required

Body Params

body
string
required
description
string
stories
boolean
required
stories_required
boolean
timelines
boolean
channels
boolean
required

If true, it's possible to place publications based on this model in channels that are listed in can_publish_in.

channels_required
boolean
production_url
string
preview_url
string
slug
string
can_publish_in
array of strings

Should contain channel ids where this type of publication can be published in.

 

Scope: publication_models, publication_models_publish

Suggest Edits

/publication_models/{id}

 

OAuth2 Auth

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

var options = { method: 'DELETE',
  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::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/publication_models/id");

xhr.send(data);
import requests

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

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

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "code": 400,
    "message": "Bad Request",
    "errors": {
        // error message
    },
    "dbtrace": "GAE.1582021386.5349"
}

Path Params

id
string
required
 

Scope: publication_models, publication_models_delete

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

/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.

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, collections.

Scopes: assets.

Suggest Edits

Getting Started

 

Collections are grouped asset objects. You could see them as albums in you phone photo app.

Suggest Edits

/collections

 

OAuth2 Auth

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

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

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/collections")

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/collections");

xhr.send(data);
import requests

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

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

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "items": [
        {
            "id": "b0e2007d-bf07-4d81-848b-05c5995ddcbf",
            "created_on": "2020-01-16T09:32:02+00:00",
            "changed_on": "2020-01-16T09:32:02+00:00",
            "label": "Collection",
            "body": "This is the body"
        },
      	{
					// ....
        }
    ],
    "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

created_on,-created_on,changed_on,-changed,-body,body

q[0][fz]
string
 

Scopes: collections.

Suggest Edits

/collections

 

OAuth2 Auth

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

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

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/collections")

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/collections");

xhr.send(data);
import requests

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

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

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "id": "b0e2007d-bf07-4d81-848b-05c5995ddcbf",
    "created_on": "2020-01-16T09:32:02+00:00",
    "changed_on": "2020-01-16T09:32:02+00:00",
    "label": "Collection",
    "body": "This is the body"
}
{
    "code": 400,
    "message": "Bad Request",
    "errors": {
        "body": [
            "validator.error.body.required"
        ]
    },
    "dbtrace": "GAE.1579252392.3779"
}

Body Params

body
string
required
 

Scopes: collections, collections_publish.

Suggest Edits

/collections/{id}

 

OAuth2 Auth

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

var options = { method: 'GET',
  url:
   'https://api.eu1.prepr.io/collections/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/collections/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/collections/id");

xhr.send(data);
import requests

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

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

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "id": "3bc3c186-fc51-4ee6-99e2-0944d5899108",
    "created_on": "2020-01-15T14:13:49+00:00",
    "changed_on": "2020-01-15T14:13:49+00:00",
    "label": "Collection",
    "body": "This is the body"
}

Path Params

id
string
required

Query Params

fields
string
 

Fields: cover, assets , assets{total}.
Scopes: collections.

Suggest Edits

/collections/{id}

 

OAuth2 Auth

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

var options = { method: 'PUT',
  url:
   'https://api.eu1.prepr.io/collections/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/collections/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/collections/id");

xhr.send(data);
import requests

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

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

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "id": "b0e2007d-bf07-4d81-848b-05c5995ddcbf",
    "created_on": "2020-01-16T09:32:02+00:00",
    "changed_on": "2020-01-16T09:32:02+00:00",
    "label": "Collection",
    "body": "This is the body"
}
{
    "code": 400,
    "message": "Bad Request",
    "errors": {
        "body": [
            "validator.error.body.required"
        ]
    },
    "dbtrace": "GAE.1579252392.3779"
}
{
    "code": 404,
    "message": "Not Found",
    "dbtrace": "GAE.1579252717.2182."
}

Path Params

id
string
required

Body Params

body
string
 

Scopes: collections, collections_publish.

Suggest Edits

/collections/{id}

 

OAuth2 Auth

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

var options = { method: 'DELETE',
  url:
   'https://api.eu1.prepr.io/collections/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/collections/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/collections/id");

xhr.send(data);
import requests

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

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

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "code": 400,
    "message": "Bad Request",
    "errors": {
        "body": [
            "validator.error.body.required"
        ]
    },
    "dbtrace": "GAE.1579252392.3779"
}
{
    "code": 404,
    "message": "Not Found",
    "dbtrace": "GAE.1579252717.2182."
}

Path Params

id
string
required
 

Scopes: collections, collections_delete.

Suggest Edits

/collections/{id}/assets

 

OAuth2 Auth

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

var options = { method: 'POST',
  url:
   'https://api.eu1.prepr.io/collections/id/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/collections/id/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/collections/id/assets");

xhr.send(data);
import requests

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

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

Path Params

id
string
required

Body Params

items
object
 
items.0
object
 
items.0.id
string
required

Asset id

 

Add one or more assets to a existing collection.

Scopes: collections, collections_publish.

Suggest Edits

/collections/{id}/assets

 

OAuth2 Auth

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

var options = { method: 'DELETE',
  url:
   'https://api.eu1.prepr.io/collections/id/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/collections/id/assets")

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/collections/id/assets");

xhr.send(data);
import requests

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

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

Body Params

items
object
 
items.0
object
 
items.0.id
string
required

Asset id

 

Remove one or more assets from a collection.

Scopes: collections, collections_publish.

Suggest Edits

/collections/{id}/cover

 

OAuth2 Auth

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

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

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/collections/id/cover")

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/collections/id/cover");

xhr.send(data);
import requests

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

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

Path Params

id
string
required

Body Params

id
string
required

Asset id

 

Scopes: collections, collections_publish.

Suggest Edits

Getting Started

 

Explore the Audience API in Postman.

Postman Environment variables: url, access_token, person_id, domain, password, personal_access_token.

Run in Postman

 

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
blocked_on
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
stripe_plans
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"
		}	
	]
}

Blocked On

The date filter can be used with the operators lt, lte, gt, gte and accepts UTC timestamps.
You can also filter on has and hasn and accepts boolean values.

{
	"blocked_on" : [
		{
			"lt" : 1577836800,
			"lte" : 1577836800,
			"gt" : 1577836800,
			"gte" : 1577836800,
      "has": true,
      "hasn": true
		}	
	]
}

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
 

While Prepr offers a full suite of solutions designed to help clients comply with applicable data privacy laws, it is the clients' responsibility to comply with its obligations under such data privacy laws. Please consult with your legal team regarding such data privacy laws prior to implementation of Prepr.

Scopes: persons, persons_publish.
Events: person.created.

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
 

Fields: gender, date_of_birth, age, profile_photo, emails, phones, bank_accounts, addresses, tags, countries, cities, zip_codes, password, segments, terms, facebook_accounts, google_accounts, stripe_customers, stripe_plans.
Scopes: persons.

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.
Events: person.changed.

Suggest Edits

/persons/{id}/oauth/access_token

 

OAuth2 Auth

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

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

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/oauth/access_token")

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/id/oauth/access_token");

xhr.send(data);
import requests

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

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

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "id": "568678925-cgfgdd-4522-8ffgs-6c273428968b",
    "created_on": "2019-05-07T09:35:34+00:00",
    "changed_on": "2019-05-17T13:08:18+00:00",
    "last_seen": "2019-12-30T13:55:53+00:00",
    "blocked_on": null,
    "label": "Person",
    "initials": "",
    "first_name": "Michael",
    "last_name": "van der Wegen",
    "full_name": "Michael van der Wegen",
    "access_token": {
        "access_token": "3dd1519751f5e4cd-f5a27380abcfcgfgdd70c6",
        "type": "User",
        "token_type": "Bearer",
        "expires_in": 3600
    }
}

Path Params

id
string
required

Body Params

ttl
date-time

UNIX timestamp expire time for the created accesstoken

 

This endpoint will return an Personal Access Token like if a person signs in.
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 newly generated ID.

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.
Events: person.deleted.

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

Fields explained

 

Returns all Email items attached to the Person.

{
	"id": "586a4ce-404e-4d6c-aca4-8782c8d7b5",
	"created_on": "2019-12-21T16:12:39+00:00",
	"changed_on": null,
	"label": "Email",
	"email": "[email protected]"
}

Field: emails.

Returns all Phone items attached to the Person.

{
	"id": "6ee11ad9-cb52-4a6a-8f8a-a2cd83",
	"created_on": "2019-12-21T16:12:39+00:00",
	"changed_on": null,
	"label": "Phone",
	"phone": "+398373737305"
}

Field: phones.

Suggest Edits

StripeCustomer

 

Returns all StripeCustomer items attached to the Person.

{
	"id": "cus_GOv5Q3Vp3Gkm",
	"created_on": "2019-12-21T12:46:16+00:00",
	"changed_on": "2019-12-21T12:46:16+00:00",
	"label": "StripeCustomer"
}

Connecting your Stripe Account is required for using this field.

Field: stripe_customers.

Suggest Edits

StripePlan

 

Returns all StripePlan items the StripeCustomer is subscribed to. The quantity is a sum of all subscriptions for the attached plan.

{
	"quantity": 1,
		"plan": {
			"id": "plan_GJkJ8EVQ",
			"created_on": "2019-12-21T13:02:48+00:00",
			"changed_on": "2019-12-21T13:02:48+00:00",
			"label": "StripePlan",
			"body": "Monthly"
		}
}

Connecting your Stripe Account is required for using this field.

Field: stripe_plans.

Suggest Edits

Getting Started

 

Explore the Audience Sign-in API in Postman.

Postman Environment variables: url, access_token, domain, password, magic_link_email_template_id, personal_access_token, emailed_access_token.

Run in Postman

Suggest Edits

/persons/sign_in

Email + password sign-in

 

OAuth2 Auth

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

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

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/sign_in")

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/sign_in");

xhr.send(data);
import requests

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

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

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
	"id": "7113999-8462-47a4-b8b-9b2aba8aa29",
	"created_on": "2019-12-21T12:45:54+00:00",
	"changed_on": "2019-12-21T16:30:55+00:00",
	"last_seen": "2019-12-21T16:35:41+00:00",
	"blocked_on": null,
	"label": "Person",
	"first_name": "Jane",
	"last_name": "Doe",
	"access_token": {
		"access_token": "d059805bf91bd58a24ee7c35e79a7abd58a24eec0035e772e",
		"type": "User",
		"token_type": "Bearer",
		"expires_in": 3600
	}
}

Body Params

email
string
required
password
string
required
ttl
string

UNIX timestamp when the access token should expire

 

The Personal Access Token will receive the user-scopes added to the App requesting the log-in. Contact Prepr Support before use.

Scopes: persons_sign_in.

Suggest Edits

/persons/request_sign_in

Magic Link sign-in (step 1)

 

OAuth2 Auth

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

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

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/request_sign_in")

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/request_sign_in");

xhr.send(data);
import requests

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

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

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
	"id": "7113999-8462-47a4-b8b-9b2aba8aa29",
	"created_on": "2019-12-21T12:45:54+00:00",
	"changed_on": "2019-12-21T16:30:55+00:00",
	"last_seen": "2019-12-21T16:35:41+00:00",
	"blocked_on": null,
	"label": "Person",
	"first_name": "Jane",
	"last_name": "Doe"
}

Body Params

email
string
required
email_template
object
 
email_template.id
string
required
 

This endpoint can also be used to implement a password recovery flow.

Scopes: persons_sign_in.

Suggest Edits

/persons/sign_in_with_magic

Magic Link sign-in (step 2)

 

OAuth2 Auth

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

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

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/sign_in_with_magic")

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/sign_in_with_magic");

xhr.send(data);
import requests

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

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

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
	"id": "7113999-8462-47a4-b8b-9b2aba8aa29",
	"created_on": "2019-12-21T12:45:54+00:00",
	"changed_on": "2019-12-21T16:30:55+00:00",
	"last_seen": "2019-12-21T16:35:41+00:00",
	"blocked_on": null,
	"label": "Person",
	"first_name": "Jane",
	"last_name": "Doe",
	"access_token": {
		"access_token": "d059805bf91bd58a24ee7c35e79a7abd58a24eec0035e772e",
		"type": "User",
		"token_type": "Bearer",
		"expires_in": 3600
	}
}

Body Params

ttl
string

UNIX timestamp when the access token should expire

 

The Personal Access Token will receive the user-scopes added to the App requesting the log-in. Contact Prepr Support before use.

Requires a Personal Sign-in Access Token received from the Request Magic Sign-in endpoint or Prepr Social Sign-in.

Scopes: persons_sign_in.

Suggest Edits

/persons/sign_out

 

OAuth2 Auth

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

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

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/sign_out")

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/sign_out");

xhr.send(data);
import requests

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

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

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

// empty response
 

Requires a Personal Access Token.
Scopes: persons_me.

Suggest Edits

/persons/me

 

OAuth2 Auth

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

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

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/me")

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/me");

xhr.send(data);
import requests

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

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

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
	"id": "7113999-8462-47a4-b8b-9b2aba8aa29",
	"created_on": "2019-12-21T12:45:54+00:00",
	"changed_on": "2019-12-21T16:30:55+00:00",
	"last_seen": "2019-12-21T16:35:41+00:00",
	"blocked_on": null,
	"label": "Person",
	"first_name": "Jane",
	"last_name": "Doe"
}
 

This endpoint is available as GET, PUT and DELETE. There references to the /person/{id} endpoints for the logged-in Person when using a Personal Access Token.

Requires a Personal Access Token.
Scopes: persons_me.

Suggest Edits

Quickstart Facebook

 

This is a Quickstart guide setting up a Facebook App to work with Prepr Social Sign-in.

Create and setup a Facebook App

  1. Go to Facebook for Developers and create a developer account if you haven't already done so.

  2. Login to the Facebook Developers Dashboard .

  3. Create a Facebook app.

By default your new app will come with the default and email scope.
If your app requires more scopes, request a Login Review with Facebook. For more information on Facebook scopes, see Login Permissions.

  1. On the Dashboard page, expand Settings on the left and then click Basic.

  2. Save the App ID and App Secret values you need those when setting up the Facebook App in Prepr.

Add the Facebook App to Prepr Integrations

  1. Go to Settings -> Integrations in the Prepr Console.

  2. Click Activate on the Facebook App tile.

  3. Enter the App ID and App Secret you obtained from the Facebook Developers Dashboard and give the Facebook App a name.

  4. If your app requires additional scopes, check the scopes that Prepr should request on sign-in.

Configure the Facebook app to work with Prepr

  1. On the Facebook App Dashboard page, click the + next to Products and click Set Up on the Facebook Login title.

  2. Select Web on the Quickstart page.

  3. Add the login domain you obtained from the Prepr Console in the Site Url box and click Save, then Continue.

  4. Click Settings below Facebook Login on the left side of the page.

  5. Add the redirect url you obtained from the Prepr Console to the list of Valid OAuth Redirect URIs and click Save.

Sign-In with a Facebook HTML link

Create a link that the person clicks to sign-in. The HREF for that link is the authorize URL that you obtained from the Prepr Console after creating the integration.

<a href="https://example.prepr.io/sign_in/facebook/37648gjhgsd23648763
         2?redirect_url=https%3A%2F%2Fexample.com%2F&state=sjhdkash3272jh&nonce=shJHh321s1dad">Continue with Facebook</a>

After the user clicks the link, they are prompted to sign in with Facebook. After a successful sign in, the user is returned to the specified redirect_url.

The AccessToken added to the url can be exchanged for a Personal Access Token using the /persons/sign_in_with_magic endpoint.

Scopes: persons_sign_in.

Suggest Edits

Quickstart Google

 

This is a Quickstart guide setting up a Google App to work with Prepr Social Sign-in.

Create and setup a Google App

  1. Go to the Google Developers Console and create a project if you haven't already done so.

  2. Save the OAuth client ID and secret values so you can add them to Prepr.

  3. The Authorized redirect URIs section can be left blank for now.

Add the Google App to Prepr Integrations

  1. Go to Settings -> Integrations in the Prepr Console.

  2. Click Activate on the Google App tile.

  3. Enter the App ID and App Secret you obtained from the Google Developers Console and give the Google App a name.

  4. If your app requires additional scopes, check the scopes that Prepr should request on sign-in.

Configure the Google app to work with Prepr

  1. On the Google API's & Services dashboard, click Credentials.

  2. Click the right Google App and find the Authorised redirect URIs section on that page.

  3. Add the redirect url you obtained from the Prepr Console to the list of Authorised redirect URIs and click Save.

Sign-In with a Google HTML link

Create a link that the person clicks to sign-in. The HREF for that link is the authorize URL that you obtained from the Prepr Console after creating the integration.

<a href="https://example.prepr.io/sign_in/google/37648gjhgsd23648763
         2?redirect_url=https%3A%2F%2Fexample.com%2F&state=sjhdkash3272jh&nonce=shJHh321s1dad">Sign-in with Google</a>

After the user clicks the link, they are prompted to sign in with Google. After a successful sign in, the user is returned to the specified redirect_url.

The AccessToken added to the url can be exchanged for a Personal Access Token using the /persons/sign_in_with_magic endpoint.

Scopes: persons_sign_in.

Suggest Edits

Getting Started

 

Explore the Audience Interactions API in Postman.

Postman Environment variables: url, access_token , personal_access_token, publication_id.

Run in Postman

Prepr's Recommendation Engine uses real- time user interactions to generate recommendations. Recording as many types of user interactions as possible increases the recommendation quality. For Likes, Views and Subscribes we have created some dedicated endpoints (see below).

Interaction types (labels)

There are several user interaction types that you can record as users browse your site.

label
action

View

Views publication detail page

Like

Likes publication

Subscribe

Subscribes to publication

Bookmark

Bookmarks publications

Share

Shares publication on site or socials

Purchase

Completes checkout for publication

Opened

Opens email (newsletters) publication

Commented

Commented on a publication

Search

Searches publication(s)

GET request to /interactions/labels will also return this list.

About the timestamp

When you record a user interaction, be sure to include an accurate timestamp of when the interaction occurred as the created_on param. Accurate timestamps ensure that model stores interactions in the correct order.

Suggest Edits

Tracking with a Pixel

 

To start collecting basic interaction data from a website you can use the Prepr Open Pixel to record a event stream.

  1. Sign in to your Prepr account:

    • Go to login.prepr.io
    • Sign in with your Prepr account credentials and navigate to the Environment you want to record events for.
  2. Create an Access token

    • Go to Settings -> Access tokens and click Add access token.
    • Enter Tracking Pixel {{URL}} and replace {{url}} by the domain (e.g., example.com, not www.example.com/) you are going to use the tracking pixel on.
    • Click save
    • Copy the generated access token, you need this later.
  3. Add the code snippet to your website

This is the Prepr Open Pixel (openpixel.js) tracking code. Copy and paste this code as the first item into the <HEAD> of every web page that you want to track. Replace {{ACCESS_TOKEN}} with the access token created in Step 2.

<!-- Start Prepr Open Pixel -->
<script>
  !function (e, t, n, p, o, a, i, s, c) {
  e[o] || ((i = e[o] = function () {
    i.process ? i.process.apply(i, arguments) : i.queue.push(arguments)
  }).queue = [], i.t = 1 * new Date, (s = t.createElement(n)).async = 1, s.src = "https://cdn.tracking.prepr.io/js/openpixel.min.js?t=" + 864e5 * Math.ceil(new Date / 864e5), (c = t.getElementsByTagName(n)[0]).parentNode.insertBefore(s, c))
}(window, document, "script", 0, "opix"),
  opix("init", "{{ACCESS_TOKEN}}");
</script>
<!-- End Prepr Open Pixel -->

Tracking Events

After you implemented the Prepr Open Pixel to your website we can start recording events on the page. Events are person interactions with content that can be measured independently from a web page or a screen load.

Event hits can be sent using the event command and specifying a Interaction Label for event. The event command has the following signature:

opix('event', '{{INTERACTION_LABEL}}', {"publication":"{{PUBLICATION_ID}}"});

A list of available interaction labels can be found /interactions/labels here.

Tracking Event Fields

The following table summarizes the event fields that can be added to the request.

publication (required)

Unique id for a Prepr Publication

person

Person id references a user in Prepr

If a person is not supplied a unique id will be generated.

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": "Subscribe"
        },
        {
            "body": "Bookmark"
        }
    ],
    "total": 3,
    "after": "YWZ0ZXJfMjU=",
    "before": "YmVmb3JlXzA=",
    "skip": 0,
    "limit": 25
}
 

Scopes: all keys can access this resource.

Suggest Edits

Likes, Bookmarks, Subscribes & Views

 

Prepr's Recommendation Engine uses real- time user interactions to generate recommendations. Recording as many types of user interactions as possible increases the recommendation quality. For Likes, Bookmarks, Subscribes and Views we have created some dedicated endpoints.

You can find examples of how to subscribe, bookmark or like a publication below. For other interaction types, see Users Interactions above.

Suggest Edits

/persons/{id}/subscriptions

This endpoint lists all publications the person is subscribed to (or has liked/bookmarked).

 

OAuth2 Auth

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

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

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/subscriptions")

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/subscriptions");

xhr.send(data);
import requests

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

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

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

{
    "items": [
        {
            "id": "96674367a5-c459-427d-9793-6b93da435345c30",
            "created_on": "2019-05-09T06:52:23+00:00",
            "changed_on": "2019-10-31T09:14:47+00:00",
            "label": "Publication",
            "publish_on": {
                "nl-NL": "2019-05-09T06:52:00+00:00"
            },
            "slug": {
                "nl-NL": "floortje-naar-afrika"
            }
        }
    ],
    "total": 1,
    "after": "YWZ0ZXJfMjU=",
    "before": "YmVmb3JlXzA=",
    "skip": 0,
    "limit": 25
}

Path Params

id
string
required
 

This endpoint is also available for likes. Use bookmarks / likes instead of subscriptions.

All fields supported on the Publications endpoint are available.
Scopes: persons.

Suggest Edits

/publications/{id}/{label}

 

OAuth2 Auth

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

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

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/label")

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/label");

xhr.send(data);
import requests

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

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"
}

Path Params

id
string
required
label
string
required

Interaction label, one of bookmark, view, like or subscribe.

Body Params

person
object
 
person.id
string
person.reference_id
string
value
float
data
object
 
data.*
array of mixed types

Key value array to add custom info to the interaction (string, int, float allowed)

 

If a Personal Access Token is used, all Person variables will be overwritten by the signed-in person.

Events: person.subscribed, person.liked.
Scopes: publications, persons_me.

Suggest Edits

/publications/{id}/{label}

 

OAuth2 Auth

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

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

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/label")

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/label");

xhr.send(data);
import requests

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

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

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

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

Path Params

id
string
required
label
string
required

Interaction label, one of like or subscribe, bookmark.

Body Params

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

If a Personal Access Token is used, all Person variables will be overwritten by the signed-in person.

Events: person.unsubscribed, person.unliked.
Scopes: publications, persons_me.

 

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

/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"
        }
    ]
}
 
 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.