Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

POST /endpoints

Parameters

Parameter

Type

Description

key

String

device token (for apple) or registration id (for android)

type

Integer

30 - Apple Push Notification

40 - Google Cloud Messaging

Response

curl -X POST -H "X-ApiToken: 6366a7018a39536a1ef4b63626f8e734" \
  -d "key=12345&type=30" \
  https://api.vsee.me/api_v3/endpoints

{
    "data": {
        "id": "551c5f64-a6d8-425d-b89c-581fac1f0144",
        "key": "123456",
        "user_id": "201",
        "type": 30,
        "created": 1427922788,
        "modified": 1427922788
    }
}

GET /endpoints

Retrieve all notification endpoints for current user

Parameters

Parameter

Type

Description

type

Integer

(empty) - get all type of endpoints for current user

30 - Apple Push Notification

40 - Google Cloud Messaging

Response

curl -X GET -H "X-ApiToken: 6366a7018a39536a1ef4b63626f8e734" https://api.vsee.me/api_v3/endpoints.json

{
    "data": [
        {
            "id": "551c5f64-a6d8-425d-b89c-581fac1f0144",
            "key": "123456",
            "user_id": "201",
            "type": 30,
            "arn": "arn:aws:sns:us-west-2:048881245029:endpoint\/APNS\/com.vsee.isos.TeleAssistance\/203fd06c-e559-3fba-a47f-87844eca4e6e",
            "created": 1427922788,
            "modified": 1427922788
        },
        {
            "id": "551c6005-83d0-48f0-abfe-59c4ac1f0144",
            "key": "an@vsee.com",
            "user_id": "201",
            "type": 10,
            "created": 1427922949,
            "modified": 1427922949
        }
    ]
}

GET /endpoints/:id

Parameters

Parameter

Type

Description

type

Integer

(empty) - get all type of endpoints for current user

30 - Apple Push Notification

40 - Google Cloud Messaging

Response

curl -X GET \
  -H "X-ApiToken: 6366a7018a39536a1ef4b63626f8e734" \
  https://api.vsee.me/api_v3/endpoints/551c5f64-a6d8-425d-b89c-581fac1f0144

{
    "data": {
        "id": "551c5f64-a6d8-425d-b89c-581fac1f0144",
        "key": "123456",
        "user_id": "201",
        "type": 30,
        "created": 1427922788,
        "modified": 1427922788
    }
}

DELETE /endpoints/:id

Parameters

Parameter

Type

Description

Response

curl -X DELETE \
  -H "X-ApiToken: 6366a7018a39536a1ef4b63626f8e734" \
  https://api.vsee.me/api_v3/endpoints/551c5f64-a6d8-425d-b89c-581fac1f0144


{
    "data": {
        "id": "551c5f64-a6d8-425d-b89c-581fac1f0144",
    }
}

GET /notifications

Reference here for more information: https://docs.google.com/document/d/1o-FH6yKDd8g4ecRZhJT91O8SL7luucK_zyxIFUaHxSw/edit#heading=h.gpbb94y21tki

Parameters

Parameter

Type

Description

size

Integer

(optional) Fetch size, how many records to fetch, default to 10

last

Integer

(optional) unix timestamp in ms, only fetch notifications before this time (please use the fieldĀ mtime)

Response

curl -X GET \
  -H "X-ApiToken: 6366a7018a39536a1ef4b63626f8e734" \
  https://api.vsee.me/api_v3/notifications.json

{
  "data": [
    {
      "id": "570f3f04-f1f4-4805-946e-178d50e631f8",
      "user_id": "201",
      "type": "foodlog.comment",
      "time": "1460616964",
      "mtime": 14606169641000,
      "is_new": false,
      "read": false,
      "title": "Johnathon Lavon commented on a photo",
      "image": "http://api.vsee.me/files/index/food/photo/1/250x250?auth_code=b9b6746928de9450db3c1265d2d90edf83c14688",
      "data": {
        "food_id": "1",
        "food_comment_id": "1"
      }
    }
  ]
}

PUT /notifications/:id

Mark a notification as read

Parameters

Parameter

Type

Description

id

String

Notification id

Response

Notification object

curl -X PUT \
  -H "X-ApiToken: 6366a7018a39536a1ef4b63626f8e734" \
  https://api.vsee.me/api_v3/notifications/570f3f04-f1f4-4805-946e-178d50e631f8

{
  "data": {
      "id": "570f3f04-f1f4-4805-946e-178d50e631f8",
      "user_id": "201",
      "type": "foodlog.comment",
      "time": 1460616964,
      "mtime": 14606169641000,
      "is_new": false,
      "read": true,
      "title": "Johnathon Lavon commented on a photo",
      "image": "http://api.vsee.me/files/index/food/photo/1/250x250?auth_code=b9b6746928de9450db3c1265d2d90edf83c14688",
      "data": {
        "food_id": "1",
        "food_comment_id": "1"
      }
  }
}

GET /notifications/badge

Get the badge number for notifications

Parameters

(None)

Response

curl -X GET \
  -H "X-ApiToken: 6366a7018a39536a1ef4b63626f8e734" \
  https://api.vsee.me/api_v3/notifications/badge

{
  "data": 5
}

POST /notifications/badge

Reset the badge number for notifications

Parameters

(None)

Response

curl -X POST -H "X-ApiToken: 6366a7018a39536a1ef4b63626f8e734" https://api.vsee.me/api_v3/notifications/badge

{
  "data": true
}
  • No labels