Skip to content

hnhtag/fcm-node-test-api

Repository files navigation

FCM NODE ADMIN SDK

API doc

Get list of client tokens

/api/fcm/token/list [GET]

Response:

{
  "clientTokens": [
    {
      "uuid": "<string>",
      "token": "<string>"
    }
  ]
}

Send token to Server

/api/fcm/token/save [POST]

Body:

{
   "token": "required string",
   "uuid": "<empty for new | required for subscribed user>" 
} 

For the first time of token saving, you can ignore uuid, server will generate and return uuid and token as response. uuid must be set for next saving token after uuid was generated

Response for new token

{ 
  "message": "token is saved", 
  "data": { 
    "uuid": "", 
    "token": "" 
  } 
}

Response for subscribed token

{ 
  "message": "token is updated", 
  "data": { 
    "uuid": "", 
    "token": "" 
  } 
}

Delete token from Server

/api/fcm/token/delete/{uuid} [DELETE]

Param: uuid

Subscribe to topic

/api/fcm/topic/subscribe [POST]

Body:

{ 
   "topic": "", 
   "uuid": "" 
} 

Unsubscribe from topic

/api/fcm/topic/unsubscribe [DELETE]

Body:

{ 
   "topic": "", 
   "uuid": "" 
}

Send message to uuid

/api/fcm/send/message [POST]

Body:

{ 
   "type":"data | default", 
   "uuid": "",
   "title": "" ,
   "body": "" 
}

type's value accepts two string ['data', 'default']

See: 'message types'

Send message to topic

/api/fcm/send/message/topic [POST]

Body:

{ 
   "type": "", 
   "topic": "", 
   "title": "",
   "body": "" 
} 

About

simple push notification api [FCM, Node Admin SDK]

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published