The b(ack)log

A P2PU API story

We’ve had some thoughts, talk and implementation for a P2PU API. It seems like everyone agrees that it’s a good idea and something that we need, but we are lacking concrete use cases. Maybe because we don’t have the complete API yet – the classic chicken and egg problem.

So I propose that we start by building a few prototypes of what we would like to use an API for. A prototype doesn’t need to be a running program, although a running prototype would be great! We just need something a little bit more tangible to help us think about the ideal API that we want for P2PU.

A prototype may look something like this:

Lets say you want to build something to run a MOOC, you will need to use the following parts of P2PU:

User story

So lets think up a little about a user story:

You go to and see a mooc that you like – “The study of geographic and temporal art as encountered in urban environments – SOGTA”. You decide to sign up for the MOOC. When you click on sign-up you get redirected to P2PU to sign-in to your P2PU profile. Once you signed in, you are asked by P2PU if you want to allow to send you notifications and publish activities to your activity feed?

Once you confirm you are redirected back to You am now signed up for SOGTA with your P2PU profile. On you can participate in group discussions. Whenever you get a reply to a message that you posted in a discussion, you receive an email in your inbox. When you reply to the email, your message is also posted in the group discussion thread.

Every week you receive an email from the MOOC organizer that informs you what’s happening with SOGTA.

On there is a list of courses that is relevant to SOGTA. You can participate in these courses together with other people that is also signed up for SOGTA. There is also lots of references to other learning resources like coursera.

Finally, after participating in the MOOC, you receive a SOGTA participation badge to show that you completed the MOOC. This badge is shown on your profile at P2PU, but it’s stored in your open badge backpack.


Interaction between and may look like this.

When someone at creates a new MOOC, the MOOC gets published to the course register at PUT {‘title’: ‘The study of geographic and temporal art as encountered in urban environments’, ‘shortcode’: ‘SOGTA’, ‘signup-url’:’’, ‘course-style’:’MOOC’,  ‘tags’:[‘art’,’geo-art’], … }

Now the “The study of geographic and temporal art as encountered in urban environments” will show up when someone searches for “geographic art” on the P2PU course register! also support GET,POST and DELETE to query, update and delete courses from the course register

When a user signs up for a MOOC on, the browser will be redirected to After the user successfully logged in, they get a token and user profile from and that is passed onto (handled by javascript without the user knowing anything about it). then does a post to POST {‘user-profile’:’’, ‘token’:’bd46c283195c0aefaffb179f6197f18d184d38b8′}

which respons with 200 OK to indicate that the user is logged in and that the token is valid. can now safely add to the list of users that signed up for the MOOC. also sends a message to to give the user instructions about SOGTA POST {‘user-profile’:’’, ‘subject’:’Welcome to SOGTA’, ‘content’:’We are glad that you joined SOGTA …’ } automatically add ‘app’:’’ to the data and depending on the user’s preferences is sent a message to the email address registered with

Whenever a significant action is performed in SOGTA by a user, does the following: PUT {‘subject’:’’, ‘verb’:’post’, ‘object’:’’, ‘verb-url’:’′, ‘message’:’user posted a comment in the MOOC SOGTA’}

This is only allowed if user gave permission to to post activity. If this failed may choose to do PUT {‘verb’:’post’, ‘object’:’’, ‘verb-url’:’′, ‘message’:’A new comment was posted in the MOOC SOGTA’} GET {‘noun’:’’} – will return all activities involving user GET {‘noun’:’’} – will return all activities involving SOGTA

When a user makes a comment and receives a reply, something like this can happen: PUT {‘profile’:’’, ‘subject’:’[SOGTA] reply to comment’, ‘message’:’Someone replied to your comment’, ‘email-reply-possible’:’True’}

This call returns {‘reply-token’:’005f035e7d1b1c2ff6de0d4a73cc2f040d5b4127′} to

The user receives an email if notifications are allowed for The email look like this:

Subject: [] [SOGTA] reply to comment
Someone replied to your comment.

You can respond by replying to this email with your text:

When the user replies to the email, gets a post from at the URL that had to supply when registering to use the P2PU API: PUT {‘from’:’’, ‘reply-token’:’005f035e7d1b1c2ff6de0d4a73cc2f040d5b4127′, ‘message’:’???’}

I haven’t yet thought through the badge API for this scenario.

So start thinking about how you would like to use an API to interact with P2PU and what you will build and send it to us at