N
Novu7mo ago
coldbell

API UnsetCredentials (FCMToken)

I am using FCM to send push notifications, and I am trying to unset the credentials of the subscriber's FCM token. However, I am encountering the following error:
data: {
message: 'Subscribers environment (664adb5ab9e7a05865b92156) do not have active firebase-cloud-messaging-692i3c49r integration.',
error: 'Bad Request',
statusCode: 400
}
data: {
message: 'Subscribers environment (664adb5ab9e7a05865b92156) do not have active firebase-cloud-messaging-692i3c49r integration.',
error: 'Bad Request',
statusCode: 400
}
addition info subscriber id : caa61cabcdb7094e41a6a554ae19639c already active integration subscriber id : caa61cabcdb7094e41a6a554ae19639c
No description
2 Replies
Ask Inkeep
Ask Inkeep7mo ago
Hi @coldbell, I'm an AI assistant for Novu. While a team member reviews this question, I'll see if I can find relevant sources for your question. ----------------------------- While I generate an answer, here are some sources that might be helpful: * Firebase Cloud Messaging (FCM) * Slack * Push Channel Introduction * Push ----------------------------- Answer The error message you're encountering suggests that there is an issue with the integration identifier or the status of the Firebase Cloud Messaging (FCM) integration in your Novu environment. It indicates that the specific integration (firebase-cloud-messaging-692i3c49r) is not active or properly configured for the environment associated with your subscriber ID. To resolve this issue, you should ensure that the FCM integration is correctly enabled and configured in your Novu dashboard. Check if the integration identifier used in your API calls matches the one configured in your Novu environment. If you need to unset the FCM credentials for a subscriber, you can use the API to update the subscriber credentials and pass an empty array for the device tokens, as illustrated in the following example:
curl --request PUT \
--url 'https://api.novu.co/v1/subscribers/{subscriber_id}/credentials' \
--header 'Content-Type: application/json' \
--header 'Authorization: ApiKey <YOUR_API_KEY>' \
--data '{
"credentials": {
"deviceTokens": []
},
"integrationIdentifier": "firebase-cloud-messaging-692i3c49r",
"providerId": "fcm"
}'
curl --request PUT \
--url 'https://api.novu.co/v1/subscribers/{subscriber_id}/credentials' \
--header 'Content-Type: application/json' \
--header 'Authorization: ApiKey <YOUR_API_KEY>' \
--data '{
"credentials": {
"deviceTokens": []
},
"integrationIdentifier": "firebase-cloud-messaging-692i3c49r",
"providerId": "fcm"
}'
Ensure that you replace {subscriber_id} with the actual subscriber ID, <YOUR_API_KEY> with your Novu API key, and "integrationIdentifier" with the correct identifier for your FCM integration. This approach will remove the device tokens associated with the FCM provider for the specified subscriber, effectively unsetting the FCM credentials. If the integration is correctly configured and active, this should resolve the error you are experiencing. Glad I could be helpful. Feel free to create a new thread with any new questions you may have. Glad I could be helpful. Feel free to create a new thread with any new questions you may have.
coldbell
coldbellOP7mo ago
The provider ID was Fcm, not firebase-cloud-messaging-692i3c49r. Resolved.
Want results from more Discord servers?
Add your server