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

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.

Related

Strapi API register returning a 400 error

I’ve been creating a web app with a login and a registration function and so far everything has been going great. I managed to connect the app to the api/auth/local api endpoint and send some nice post requests.
Now, I’ve been trying to send requests to the http://localhost:1337/api/auth/local/register endpoint and without any success. I’ve been doing this according to:
https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html#registration
I keep getting a 400 error:
{
"data": null,
"error": {
"status": 400,
"name": "ApplicationError",
"message": "An error occurred during account creation",
"details": {
}
}
}
If I try to send a request with an email that’s already registered in strapi, the response will give me the correct error:
{
"data": null,
"error": {
"status": 400,
"name": "ApplicationError",
"message": "Email is already taken",
"details": {
}
}
}
In the public and authenticated user roles, I’ve allowed every single one of them, for now.
Enable confirmation emails are set to false.
Email confirmation
Public user permission
For the headers, I’m using Content-type : application/json
the raw json body I'm posting:
{
"email": "manager1#strapi.io",
"password": "testtest1",
"username": "manager1"
}
This is my first project with strapi and so far it went pretty well. I’m not sure if I’m missing out on something or if I’m doing something else wrong.
Any help is appreciated!
I figured it out, it wasn’t as complicated as I expected.
In the user I had different fields, like firstName, lastName etc. All of these fields were required.
I made the fields not required, and now it works.

Getting GoToWebinar registrant

I'm trying to get registrant info from GoToWebinarApi (api link).
First I'm making a request to get all registrants and getting the following response:
Response body
[
{
"firstName": "Test",
"lastName": "t",
"registrationDate": "2020-06-04T08:46:44Z",
"timeZone": "Europe/Helsinki",
"joinUrl": "https://global.gotowebinar.com/join/7649495216334202379/502991121",
"registrantKey": 6700838782913279000,
"email": "tes#gmail.com",
"status": "APPROVED"
}
]
After that I'm trying to use this registrant key to get registrant info in another query but persistently getting following response:
https://api.getgo.com/G2W/rest/v2/organizers/{{organizer_key}}/webinars/{{webinar_key}}/registrants/{{registrant_key}}
{
"errorCode": "NotFound",
"description": "Registrant with specified key does not exist",
"incident": "3599905930306030349"
}
I don't know what's wrong, maybe it's a bug? It has a lot of stuff like this.
Have you tried downloading Postman and importing their collection? You can just fill in the fields and see if there's any issues. Removing the possibilities you made a mistake in your code.
https://documenter.getpostman.com/view/7571707/SVzw4fq2?version=latest#97d099de-e2b2-413c-96aa-d441d2db80c9
EDIT: Issue/Problem:
I've found the issue. Basically the numbers are too big for Javascript. See: JSON Response Long is Rounded or Corrupted and Large numbers erroneously rounded in JavaScript

Firebase Cloud Messaging Reports - not displaying sent count in Reports

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": ""
}
}

YouTube Data API V3 not returning Livestream from Channel ID

I'm working on a project that requires me to get a YouTube live stream's chat for use in my program. Everything was working perfectly with this js package, but it seems that google has changed something because it suddenly stopped working. I have regenerated keys, and am well below my quota, so I know that isn't the problem.
Strangely, when I use the youtube data api "try this api" section in their online documentation, the same problem is happening where the live stream is not found by the id. I've tried it on many different live channels, and all have returned an empty "items" array. Anyone else have this issue?
function execute() {
return gapi.client.youtube.search.list({
"part": "snippet, id",
"channelId": "UCSJ4gkVC6NrvII8umztf0Ow",
"eventType": "live",
"type": "video"
})
.then(function(response) {
// Handle the results here (response.result has the parsed body).
console.log("Response", response);
},
function(err) { console.error("Execute error", err); });
}
Results from the request:
{
"kind": "youtube#searchListResponse",
"etag": "\"8jEFfXBrqiSrcF6Ee7MQuz8XuAM/4y-zlkAvKOyrH7TNQpxpBtYUxKU\"",
"regionCode": "US",
"pageInfo": {
"totalResults": 0,
"resultsPerPage": 5
},
"items": []
}
I can confirm this issue but the issue is a bug from Google. Hope it gets fixed soon.
There is definitely something going on with the YouTube Data API. If you give it a try on the on the Deverloper Console for Search: list it won't work if you are providing channelId. However, if you leave channelId blank it will return all of YouTube's live streams.
Google's instructions for getting help say to add the tag google-apis-explorer to your post. I have submitted an edit to add that tag to your original post. Hopefully we'll all get some answers soon.

How to send pushes with "conditions" to pushwoosh with remote API?

I use the pushwoosh remote API and I can send pushes to all users and to just one device, good!
But now Im trying to be able to send pushes to different groups and Im trying to get "conditions" to work. But Im missing something and I don´t know what!
I have first created a tag called "Grupper" as a listtag at pushwoosh.
And it is registering the value "5A" at pushwoosh from the app.
And this is how I try to send a push from my server.
var tags="5A"
var data = {
"request": {
"application": applicationId,
"auth": authKey,
"notifications": [{
"send_date": "now",
"ignore_user_timezone": true,
"content": {
"en": pushtext
},
"conditions":["Grupper", "EQ", tags]
}]
}
};
And here its the "conditions" that is wrong somehow?
If I remove the row with "conditions" then it sends a push to all users, but if I use it, it sends nothing. No errors.
Any input really appreciated, after a couple of days trying, I still don´t know what Im missing :-)
A condition is always an array of arrays, therefore try this:
"conditions":[["Grupper", "EQ", tags]]
Also, since "Grupper" is a List-type tag, you can only use IN operator with it (see the docs here)