General concept

Id.net allows your users to communicate with their friends while using client application. This part of API covers ability of users to write messages to their friends, already registered in your application.

Create application request

For now, creating application request is only handled by SDK. You can go to SDK Documentation to find out, how it is done.

Later we will add an ability to make API requests.

Getting user application requests

Whenever request is created, separate copy for each recipient is made. When user clicks ‘Accept’ button on id.net, he is led to the redirect_uri, specified by your application, followed by request id:

http://your.app/redirect_uri?request_id=%REQUEST_ID%

To get information about this request, you can make one of the following API calls:

GET: "https://www.id.net/api/v1/json/request-[request-id]"
GET: "https://www.id.net/api/v1/json/request-[request-id]_[target-pid]"

Example request and response

Request

GET /api/v1/json/request-5257eb9aa80315f627000005
Authorization: Bearer c95f1d3ce3d4f077e4968e1a7976c9fa0fd5f90db703682c4ed29a308f58e99c

Response

{
  "id": "5319e9c19cbceac011093162",
  "message": "Hello! Join me on this awesome app!",
  "redirect_uri": "http://awesome.game.com/app_requests/callback",
  "data": "Hidden request data",
  "created_time": "2014-03-07T15:46:08Z",
}

Removing application requests

Your application is fully responsible for dealing with used requests. For example, you can expire request after recipient visits redirect_uri, or presses ‘decline’ or whatever you come up with. Requests are not automatically deleted after user presses ‘Accept’ on id.net.

DELETE: "https://www.id.net/api/v1/json/request-[request-id]_[target-id]"

Will remove request, so it won’t be shown in activity feed anymore.

Response

  true

If request was successfully deleted.