Subscribe to Church
curl --request POST \
--url https://api.thefaithapp.com/v1/subscribe \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"fcm_token": "<string>"
}
'const options = {
method: 'POST',
headers: {
'X-API-Key': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({fcm_token: '<string>'})
};
fetch('https://api.thefaithapp.com/v1/subscribe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.thefaithapp.com/v1/subscribe"
payload = { "fcm_token": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"message": "Church subscribed to Example Church",
"user": "<string>"
}{
"error_message": "Unauthorized"
}{
"error": "Client not found"
}{
"errors": {
"fcm_token": [
"The fcm token field is required."
]
}
}{
"error": "Failed to process subscription"
}Core Experience
Subscribe to Church
Subscribes the authenticated TheFaithApp member to the church represented by the client API key and stores the device FCM token for push notifications.
POST
/
v1
/
subscribe
Subscribe to Church
curl --request POST \
--url https://api.thefaithapp.com/v1/subscribe \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"fcm_token": "<string>"
}
'const options = {
method: 'POST',
headers: {
'X-API-Key': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({fcm_token: '<string>'})
};
fetch('https://api.thefaithapp.com/v1/subscribe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.thefaithapp.com/v1/subscribe"
payload = { "fcm_token": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"message": "Church subscribed to Example Church",
"user": "<string>"
}{
"error_message": "Unauthorized"
}{
"error": "Client not found"
}{
"errors": {
"fcm_token": [
"The fcm token field is required."
]
}
}{
"error": "Failed to process subscription"
}Authorizations
Public client key copied from Developer Access. The member bearer token authenticates the request.
Member access token returned by POST /v1/auth/token.
Body
application/json
FCM token for the user's device.
User's FCM device token.
Was this page helpful?