Buddies

The end point /buddies provides methods for invite buddy, remove buddy, read and update user's buddies list.

Invite buddy (deprecated)

That request creates new buddy in user profile if buddy id is found. Or we send the message to email with accept and reject links (for example 'https://dev.shping.com/buddies-service/invitation/?code=706f7303-7858-4769-86b8-694fbdda0479')

When some user trying to invite you to their buddies list through email, you will receive a letter with two links (accept and reject) on yours email address. When you click on a link (GET request to /buddies-service/invitation), you will be redirected to the web application with links for download the Shping App (IOS or Android). You must install the App and log In. After that when you will be authorized, you must click to the link again - in this case application must send the POST request with the code using the method /buddies-service/invitation.

POST /buddies-service/buddies/request
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: user id or email
Example Response
{
  "first_name": "",
  "id": "urn:authenticateit:user:email:test1@gmail.com",
  "last_name": "",
  "photo": "",
  "ts": "2017-01-16T11:49:11Z",
  "type": "request"
}

Invite list of buddies (deprecated)

POST /buddies-service/buddies/requests
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
list array Required: List of emails e.g. [“Test1@gmail.com”, “Test2@gmail.com”]
Example Request
{"list":["65qw@mailinator.com", "ikleeen@gmail.com"]}
Example Response
[
    {
        "chunk_id": "urn:authenticateit:user:buddies_chunk:8bebec9d-ba15-4a94-bf8c-6b2e4889e03d",
        "coins": "20437601000000000000000000",
        "first_name": "65",
        "id": "urn:authenticateit:user:email:65qw@mailinator.com",
        "last_name": "65",
        "level_name": "Basic",
        "level_type": "basic",
        "photo": "https://dev-cdn.shping.com/2017/9/25/2ba47240-924c-450f-832b-b22d43c762fd",
        "ts": "2017-12-06T13:39:50Z",
        "type": "request"
    },
    {
        "chunk_id": "urn:authenticateit:user:buddies_chunk:8bebec9d-ba15-4a94-bf8c-6b2e4889e03d",
        "coins": "2061000000000000000000",
        "first_name": "Ivan",
        "id": "urn:authenticateit:user:email:ikleeen@gmail.com",
        "last_name": "Vasilev",
        "level_name": "Basic",
        "level_type": "basic",
        "photo": "https://dev-cdn.shping.com/2017/9/25/2ba47240-924c-450f-832b-b22d43c762fd",
        "ts": "2017-12-06T13:39:51Z",
        "type": "request"
    }
]

Read buddies list

That request returns the current user's buddies list

GET /buddies-service/buddies
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
chunk_id string Chunk ID
Example Response
{
    "buddies_list": [
        {
            "coins": 0,
            "first_name": "",
            "id": "urn:authenticateit:user:email:1@mailinator.com",
            "last_name": "",
            "level_name": "Basic",
            "level_type": "basic",
            "photo": "",
            "ts": "2017-12-06T13:26:01Z",
            "type": "buddy"
        },
        {
            "coins": 0,
            "first_name": "",
            "id": "urn:authenticateit:user:email:2@gmail.com",
            "last_name": "",
            "level_name": "Basic",
            "level_type": "basic",
            "photo": "",
            "ts": "2017-12-06T13:26:03Z",
            "type": "invite"
        },
        {
            "coins": 0,
            "first_name": "",
            "id": "urn:authenticateit:user:email:3@gmail.com",
            "last_name": "",
            "level_name": "Basic",
            "level_type": "basic",
            "photo": "",
            "ts": "2017-12-06T13:26:03Z",
            "type": "request"
        },
        {
            "coins": 0,
            "first_name": "",
            "id": "urn:authenticateit:user:email:4@gmail.com",
            "last_name": "",
            "level_name": "Basic",
            "level_type": "basic",
            "photo": "",
            "ts": "2017-12-06T13:26:03Z",
            "type": "request"
        }
    ],
    "id": "urn:authenticateit:user:buddies_chunk:3c2c2c32-8e0b-48bd-96a2-fa1f5671632e",
    "next": "urn:authenticateit:user:buddies_chunk:8bebec9d-ba15-4a94-bf8c-6b2e4889e03d",
    "owner": "urn:authenticateit:user:buddies_chunk:8bebec9d-ba15-4a94-bf8c-6b2e4889e03d",
    "previous": null
}

Adding description to buddy

That request creates buddy's description

POST /buddies-service/buddies/description
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Buddy id
description string Required: Description
chunk_id string Chunk ID
Example Request
{"chunk_id":"urn:authenticateit:user:buddies_chunk:3c2c2c32-8e0b-48bd-96a2-fa1f5671632e", "id":  "urn:authenticateit:user:email:1@mailinator.com", "description" : "Some text"}
Example Response
{
    "status": "Description updated"
}

Adding family status to buddy

That request creates buddy family status

POST /buddies-service/buddies/status
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Buddy id
status string Required: Values: "family_together", "family_separately", "friend", "other"
chunk_id string Chunk ID
Example Request
{"chunk_id":"urn:authenticateit:user:buddies_chunk:3c2c2c32-8e0b-48bd-96a2-fa1f5671632e", "id":  "urn:authenticateit:user:email:1@mailinator.com", "status" : "family_together"}
Example Response
{
    "status": "Status updated"
}

Read buddies list by status

Filter buddies by status

GET /buddies-service/buddies/status
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Buddy id
status string Values: "family_together", "family_separately", "friend", "other"
Example Response
[
        {
            "coins": 0,
            "first_name": "",
            "id": "urn:authenticateit:user:email:1@mailinator.com",
            "last_name": "",
            "level_name": "Basic",
            "level_type": "basic",
            "photo": "",
            "ts": "2017-12-06T13:26:01Z",
            "status": "family_together",
            "type": "buddy"
        },
        {
            "coins": 0,
            "first_name": "",
            "id": "urn:authenticateit:user:email:2@gmail.com",
            "last_name": "",
            "level_name": "Basic",
            "level_type": "basic",
            "photo": "",
            "ts": "2017-12-06T13:26:03Z",
            "status": "family_together",
            "type": "invite"
        }
]

Buddy's status update

That request updating buddy's status. If someone invited us - we can accept or reject the invitation. If the user is in the list of buddies - we can remove it

POST /buddies-service/buddies
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Buddy id
action string Required: close - reject invitation, apply - accept invitation (invite → buddy), delete - remove buddy
chunk_id string Chunk ID
Example Request
{"action":"apply", "chunk_id":"urn:authenticateit:user:buddies_chunk:abd58b9b-1855-40a3-b29a-b90f95c95f5b", "id":"urn:authenticateit:user:email:newqw@mailinator.com"}
Example Response
{
    "status": "Applied"
}

Get invitation (deprecated)

That request for redirection unregistered users

GET /buddies-service/invitation
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
code string code

Post invitation (deprecated)

That request for registered users

POST /buddies-service/invitation
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
code string code
Example Response


Example Email
<p>
Please <a href="https://dev.shping.com/buddies-service/invitation/?code=ff6048aa-7ea1-49d8-bafe-12f22ffa3dc5">click here to to accept invitation</a>.
</p>
<p> 
Or you can reject it by <a href="https://dev.shping.com/buddies-service/invitation/?code=d3955457-742a-452a-8273-616c385b4ea9"> this link</a>.
</p>

Poke the buddy

That request for sending push notification to all devices in format “%USERNAME poked you”

POST /buddies-service/buddies/poke
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string buddy id
GET /buddies-service/buddies/link
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
{
    "link": "https://dev-www.shping.com/mobile/invite.html?invitation_code=80329630248"
}
POST /buddies-service/buddies/link
Parameters
Name Type Description
ticket body Session's ticket
invitation_code body Ivitation code
Example Request
{
 "invitation_code": "80329630248",
 "language": "EN-US",
 "height": 768,
 "width": 1024,
 "pixelDepth": 24,
 "colorDepth": 24
}
Example Response


results matching ""

    No results matching ""