Firebase Cloud Messaging Reports - not displaying sent count in Reports - firebase-cloud-messaging

We have set "analytics_label" in the message as stated in the documentation and the message is getting delivered as well. But we do not see any entry in the report. Please check our message string and let us know what might be wrong. Appreciate your help.
REST API being called
https://fcm.googleapis.com/fcm/send
Message being sent
{"topic":"81xxxxx42","android":{"priority":"high"},"priority":"high","fcm_options":{"analytics_label":"nwy81xxxxx42"},"data":{"MID":-1,"frm":"99xxxxx32","MTP":9,"msg":""}}

I'm not certain what library you're using or if you're just POSTing directly to the REST API, but looking at code that I know works I think you just need to make fcm_options and analytics_label camel case.
{
"topic": "81xxxxx42",
"android": {
"priority": "high"
},
"priority": "high",
"fcmOptions": {
"analyticsLabel": "nwy81xxxxx42"
},
"data": {
"MID": -1,
"frm": "99xxxxx32",
"MTP": 9,
"msg": ""
}
}

Related

kucoin websocket api, how to "subscribe" to their public channel, they say no authorization required, but they ask for a token :(

The question is about kucoin websocket public channel (not trades) just last trades
I just want a live feed of trades like other crypto exchanges...
but when I want to connect to "wss://ws-api-futures.kucoin.com/endpoint" I get WebSocketError: Received unexpected status code (401 Unauthorized)
the documentation https://docs.kucoin.com/futures/#create-connection lack explications :(
normally with other exchanges I can just do this in javascript
bybit_market_ws = new WebSocket("wss://stream.bybit.com/spot/quote/ws/v2");
bybit_market_ws.onmessage = event => bybit_trades(event.data);
bybit_market_ws.onopen = event => bybit_market_ws.send(JSON.stringify({"topic":"trade","params":{"symbol":"BTCUSDT","binary":false},"event":"sub"}));
function bybit_trades (jsonx) { console.log(JSON.parse(jsonx)); }
so how can I do that with kucoin websocket ?
according to the documentation i would need a "public token"...
but there is no explication on how to get that token :(
does someone knows how I would retrieve the last trades via websocket (public) channel ?
Note that the following steps may be changed when the API is updated.
All information can be found at https://docs.kucoin.com/#apply-connect-token
Get the public token
Send a empty http POST (GET will not work) message to https://api.kucoin.com/api/v1/bullet-public.
Response:
{
"code": "200000",
"data": {
"token": "2neAiuYvAU61ZD...",
"instanceServers": [
{
"endpoint": "wss://ws-api.kucoin.com/endpoint",
"encrypt": true,
"protocol": "websocket",
"pingInterval": 18000,
"pingTimeout": 10000
}
]
}
}
Connect to the Websocket
With the data of the repsonse above:
websocket: endpoint + "?token=" + token
Example: wss://ws-api.kucoin.com/endpoint?token=2neAiu....
Get all supported trading pairs
send a http GET message to https://api.kucoin.com/api/v1/symbols
{
"code": "200000",
"data": [
{
"symbol": "REQ-ETH",
"name": "REQ-ETH",
"baseCurrency": "REQ",
"quoteCurrency": "ETH",
...
},
{
"symbol": "BTC-USDC",
"name": "BTC-USDC",
"baseCurrency": "BTC",
"quoteCurrency": "USDC",
...
},
...
Get trading data
When the websocket connection is established send a http POST message:
{
"type": "subscribe", //subscribe or unsubscribe
"topic": "/market/ticker:BTC-USDT,BTC-USDC"
}
maybe this answer will not please you at all, but i will try, most of the people who work from the API in KuCoin do it with python, in fact the SDK for Nodejs is out of date, your best bet is to ask in the telegram channel https://t.me/KuCoin_API, there are KuCoin engineers who always help, although most of them use python, there is also the academy channel https://t.me/kucoin_learning, where there are examples, in short I can only mention references because I was also where you are, and the best I could do was that and review the SDk code and from there intuit and create my own adjustments
PD: the datafeed.js file is your best option, check it out https://github.com/Kucoin/kucoin-futures-node-sdk/blob/master/src/lib/datafeed.js

Bot not Responding Alert in Google Chat API

I have used same code as mentioned in one of the samples available on Google Chat Documentation
https://github.com/googleworkspace/hangouts-chat-samples/blob/master/java/basic-async-bot/src/main/java/com/google/chat/bot/basic/async/Bot.java
But the google chat is first giving the message "BOTNAME not responding" then the reply from the bot.
I have even tried to post the message with the thread from previous message as mentioned in the documentation. But still not getting desired result.
Any kind of help will be appreciated.
I eventually got it. Actually, I was sending a response to google chat with some content. When I modified it, by sending a response without any content, the error is resolved and it is working fine as accepted.
it's a shame I didn't see this issue before.
Check your APPSCRIPT.JSON for a chat property {} at the end. With updates when deploying is being overwritten but Google is already solving =)
Ex of my appssript.json: (Correct)
{
"timeZone": "America/Fortaleza",
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8",
"dependencies": {
"libraries": [
{
"userSymbol": "cGoa",
"libraryId": "1v_l4xN3ICa0lAW315NQEzAHPSoNiFdWHsMEwj2qA5t9cgZ5VWci2Qxv2",
"version": "36"
},
{
"userSymbol": "OAuth1",
"libraryId": "1CXDCY5sqT9ph64fFwSzVtXnbjpSfWdRymafDrtIZ7Z_hwysTY7IIhi7s",
"version": "18"
},
{
"userSymbol": "Verificacao_CallBack",
"libraryId": "1dgfE9K71u1k7tkxQHy2F2oAAAYB_lVnZOj8bmL0sl-vMEQYq8bYrDE1J",
"version": "0",
"developmentMode": true
}
]
},
"chat": {
}
}
You can deploys news versions in OLD apps script editors!

LinkedIn Share API creates a share but returns error 500

I'm asking this question on SO, since LinkedIn support is officially moved here.
I'm receiving HTTP 500 response from LinkedIn API endpoint while trying to create a share. This happens sporadically, but it is a quite often event last week or two. The weird part is that the share being created successfully.
Please advise. Could it be caused by spiking users activity on social media due to COVID19?
For the reference, here is request body POST-ed to https://api.linkedin.com/v2/shares (real ids are replaced).
{
"owner": "urn:li:organization:111111",
"text": {
"text": "Text text text"
},
"content": {
"contentEntities": [
{
"entity": "urn:li:digitalmediaAsset:111111"
}
],
"shareMediaCategory": "IMAGE"
},
"distribution": {
"linkedInDistributionTarget": {
"connectionsOnly": false,
"visibleToGuest": true
}
}
}
Response:
{
"message": "Internal Server Error",
"status": 500
}

Etsy API key Location

I don't know if I'm really confused or missing something but I can't find my Etsy API key anywhere.
I have created a new application but all it comes up with is KEYSTRING and Share secret.
I have tried to used the KEYSTRING value in
https://openapi.etsy.com/v2/users/etsystore?api_key=YOUR_API
but comes up with the wrong user or nothing at all.
Am I looking in the wrong place as Im starting to pull my hair out
Matt
Just follow the link: https://www.etsy.com/developers/register
Fill fields and create new App.
Profit! After that you'll see API key.
It worked for me by using just the "Keystring" value that i received while creating the app. The url looks like this -
https://openapi.etsy.com/v2/users/etsystore?api_key=my_keystring_value
and the response that I got was -
{
"count": 1,
"results": [
{
"user_id": xxxxxx,
"login_name": "EtsyStore",
"creation_tsz": 1282269739,
"user_pub_key": {
"key": "-----BEGIN PUBLIC KEY-----xxxx-----END PUBLIC KEY-----",
"key_id": 21832645947
},
"referred_by_user_id": null,
"feedback_info": {
"count": 3063,
"score": 100
}
}
],
"params": {
"user_id": "etsystore"
},
"type": "User",
"pagination": {}
}
I guess it could be some temporary issue.
Please make sure that the call you are using does not require an OAuth verification.
If the call does not require the Oauth verification, the KEYSTRING will be acting as the application key and can be passed with the URL for the results.

How to get the original message's message field through FbGraph /me/inbox?

I am trying to get the original message content from the /me/inbox through the API. I have authorized the read_inbox permission and got a bunch of message objects back. However, each of the message has no Subject nor Message (content). But it does contain comments which include a list of comments with the comment's message content.
Is this a permission issue? Or am I using the API wrong?
Message example below (using fake content for privacy reason.)
{
"id": "97654321",
"to": {
"data": [
{
"name": "Luke C.",
"id": "12346"
},
{
"name": "Mark D.",
"id": "12345"
}
]
},
"updated_time": "2013-01-31T19:10:17+0000",
"unread": 0,
"unseen": 0
}
Upon asking my colleague who have worked with FBgraph api for sometime already. It seems like the fbgraph inbox does behaved like this for a while and there does not seem to have any intention to fix it. And I also noticed that the me/outbox would behave as expected where a 'from'
Thus, I have moved onto using FQL to replace the me/inbox api:
SELECT body, recipients, sender, thread_id, message_id
FROM unified_message where thread_id IN
(SELECT thread_id FROM unified_thread WHERE folder = 'inbox')
If anyone know why FbGraph api does not work, please still help contribute to this question.