get
Get current subscription

https://CounterSocial.example/api/v1/push/subscription

View the PushSubscription currently associated with this access token.

Returns: PushSubscription
OAuth: User token + push
Version history:
2.4.0 - added

Request

Headers
Authorization
required
string
Bearer

Response

200: Success

{
  "id": 328183,
  "endpoint": "https://yourdomain.example/listener",
  "alerts": {
    "follow": true,
    "favourite": true,
    "reblog": true,
    "mention": true,
    "poll": true
  },
  "server_key": "BCk-QqERU0q-CfYZjcuB6lnyyOYfJ2AifKqfeGIm7Z-HiTU5T9eTG5GxVA0_OH5mMlI4UkkDTpaZwozy0TzdZ2M="
}

404: Not Found

A PushSubscription does not exist for this token.

{
  "error": "Record not found"
}

put
Change types of notifications

https://CounterSocial.example/api/v1/push/subscription

Updates the current push subscription. Only the data part can be updated. To change fundamentals, a new subscription must be created instead.

Returns: PushSubscription
OAuth: User token + push
Version history:
2.4.0 - added

Request

Headers
Authorization
required
string
Bearer
Form Data Parameters
data[alerts][follow]
optional
boolean
Receive follow notifications?
data[alerts][favourite]
optional
boolean
Receive favourite notifications?
data[alerts][reblog]
optional
boolean
Receive reblog notifications?
data[alerts][mention]
optional
boolean
Receive mention notifications?
data[alerts][poll]
optional
boolean
Receive poll notifications?

Response

200: Success

Updating a PushSubscription to only receive mention alerts

{
  "id": 328183,
  "endpoint": "https://yourdomain.example/listener",
  "alerts": {
    "follow": false,
    "favourite": false,
    "reblog": false,
    "mention": true,
    "poll": false
  },
  "server_key": "BCk-QqERU0q-CfYZjcuB6lnyyOYfJ2AifKqfeGIm7Z-HiTU5T9eTG5GxVA0_OH5mMlI4UkkDTpaZwozy0TzdZ2M="
}

404: Not Found

No existing PushSubscription for this token

{
  "error": "Record not found"
}

delete
Remove current subscription

https://CounterSocial.example/api/v1/push/subscription

Removes the current Web Push API subscription.

Returns: none
OAuth: User token + push
Version history:
2.4.0 - added

Request

Headers
Authorization
required
string
Bearer

Response

200: Success

PushSubscription successfully deleted or did not exist previously

{}

Last updated March 17, 2021 ?? Improve this page