Bluemix Push REST API messages report details - ibm-cloud

I'm trying to see why one of my apps is failing at delivering push notifications to iOS devices.
On the Push REST API doc page I saw that there was the GET /apps/{applicationId}/messages/{messageId}/report endpoint which I could use but it seems that there is little information given with that.
As a result to GET https://mobile.eu-gb.bluemix.net/imfpush/v1/apps/2cc73363-b50f-4b60-b2f9-c483ff5cd414/messages/8d58f4e/report I only get
{
"invalid": 2,
"sent": 2,
"ios": {
"invalid": 2,
"sent": 2
}
}
for a push sent to 2 ios device.
Is there a way to get more information on why the push delivery has failed/was invalid? Do you have another endpoint where I can get additional info?

Unfortunately, at this time, there is not a REST API call that will give additional error information. However, if you open a Bluemix Support ticket, we can pull additional error information from the server logs using your AppGUID.
iOS certificate issues are one of the more common of invalid messages in the message report.

#mihavr If the GET MessageID report (https://mobile.eu-gb.bluemix.net/imfpush/v1/apps/2cc73363-b50f-4b60-b2f9-c483ff5cd414/messages/8d58f4e/report) gives you invalid status for IOS device that means the problem seems to have been with push certificate is invalid and that generates invalid token when you register the ios device. Hence send message failed to deliver the message on the device and the messageID report shows Invalid status.
{
"invalid": 2,
"sent": 2,
"ios": {
"invalid": 2,
"sent": 2
}
}

Related

Google Oauh2 Verification Invalid Argument

I'm trying to submit an application for a verification through the Google Console as it has opened from today.
I have verified the domain in question through Goofle Search Console, I have ensured that all the links are set(Policy, Terms of Usage etc), filled the form with information and explanation about the scopes rhat requires verification.
When I submit the form I get no response that it's submited but the response from Network in Developer tools I see it's 400 HTTP Status and I see the following error message:
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT"
}
}
I have double checked my steps but still not able to resolve this, any information that you can provide would be great.
Adding Request:
https://clientauthconfig.clients6.google.com/v1/brands/ID/submitReview?alt=json&key=AIzaSysnipsnip0DjtiCwWBwQ1djDy741g
Above request is PUT, here is the body content
{"brandId":"ID","scopeRationale":"","additionalInfo":"","contactEmail":"contactmeialaddress#gmail.com","pendingScopes":["https://mail.google.com/","https://www.googleapis.com/auth/gmail.modify","https://www.googleapis.com/auth/gmail.compose","https://www.googleapis.com/auth/gmail.insert","https://www.googleapis.com/auth/gmail.readonly","https://www.googleapis.com/auth/contacts.readonly"],"category":[1,3,5],"scopeDetails":[{"apiGroup":1,"pendingScopes":["https://mail.google.com/","https://www.googleapis.com/auth/gmail.modify","https://www.googleapis.com/auth/gmail.compose","https://www.googleapis.com/auth/gmail.insert","https://www.googleapis.com/auth/gmail.readonly"],"scopeRationale":"Why we need access to this scope."},{"apiGroup":2,"pendingScopes":["https://www.googleapis.com/auth/contacts.readonly"],"scopeRationale":"Additional info why we need this."}]}

Facebook Messenger Sender Actions

I am trying to use Sender Actions as described in the messenger Send API docs. However when I send a typing_on POST I do no see anything happen in messenger. I have tried on chrome desktop and the messenger android app.
I am able to send a mark_seen POST and this does update the chat with an icon indicating my message has been seen.
The request body looks as follows:-
{
"recipient":{
"id":"<PSID>"
},
"sender_action":"typing_on"
}
When sending mark_seen, typing_on or typing_off I always get the following response body.
{
"recipient_id": "<PSID>"
}
Are there additional steps needed to get the typing indicator to display? Does it only work on a specific platform? I cannot find any more documentation, and I am not getting any error messages, the POST status comes back OK identically when sending mark_seen or typing_on, I just can't see any effect after typing_on.
Okay I got reply from Facebook developer team on Facebook Developers group
Quote:
"This changed recently for mobile and is currently assigned to an internal team". Looks like something internal.

What is https://i.instagram.com/api/v1

I am digging into Instagram APIs and find out a URL https://i.instagram.com/api/v1 which used by many git repos(some are recently updated) but when I go to Instagram there is no such url available there. Can anyone guide me what is the use of this url and how I can use it because when I hit
https://i.instagram.com/api/v1/accounts/login/
by POSTMAN i got below message
{
"message": "Your version of Instagram is out of date. Please upgrade your app to log in to Instagram.",
"status": "fail",
"error_type": "needs_upgrade"
}
One more thing. I am with my friend who work in android he has done reverse engineering on a app which use for increase followers and that app is also using same endpoints and working on that app.
It's November 2021, and somehow the API https://i.instagram.com/api/v1 still works, but I believe they have changed the way you use it.
NOTE: The given information is just for educational purposes
Let's take the user/{user_id}/info endpoint of this API, which returns basic information about the user_id.
The URL with this endpoint would be
https://i.instagram.com/api/v1/users/176702683/info/
If you paste this link into your browser you'll get the following message
{"message":"useragent mismatch","status":"fail"}
This means that API must be called via mobile user-agent. read more about user-agent here
We can solve this problem by providing a mobile user-agent string.
Using python requests library
!pip install requests
import requests
URL = https://i.instagram.com/api/v1/users/176702683/info/
headers = {'User-Agent':'Instagram 76.0.0.15.395 Android (24/7.0; 640dpi; 1440x2560; samsung; SM-G930F; herolte; samsungexynos8890; en_US; 138226743)'}
# samsung mobile user-agent
response = requests.get(url, headers=headers)
print(response.json())
Output:
{
"user": {
"username": "marcelotwelve",
"pk": 176702683,
"profile_pic_url": "https://instagram.fzrh3-1.fna.fbcdn.net/v/t51.2885-19/233796637_544571223333074_8761964745157634211_n.jpg?stp=dst-jpg_s150x150\\u0026_nc_ht=instagram.fzrh3-1.fna.fbcdn.net\\u0026_nc_cat=1\\u0026_nc_ohc=Cfk2kHCxgbIAX_vgNjn\\u0026edm=AEF8tYYBAAAA\\u0026ccb=7-5\\u0026oh=00_AT-tuXbAbsIkvmJqm_akQS__UPDtEXZxZChx2lO-9Wb0FQ\\u0026oe=62A8115E\\u0026_nc_sid=a9513d"
},
"status": "ok"
}
NOTE: Please be aware of how you use it
It is actually an API, that you can only use from your phone application, thats why it say it needs upgrade. you can download an addon for chrome / firefox to switch user agents, and after that you will be able to see the content.
It's worth checking there is lots of info about any user on insa
this response is a default error caused by having no cookie set
inspect instagram, you can see a redirect first (this way they fill initial cookies set for you). copy paste it to postman and try again

Facebook Send api : not able to send a message using the phone number

I am trying to use the recently release Send/Receive API for facebook messengers to build the chat bots referring to the documentation provided here: https://developers.facebook.com/docs/messenger-platform/quickstart
I have created a Facebook page and Facebook app and I am the admin of the app and have followed the steps mentioned in the documentation. I am trying to send a message to my own phone number to test it out using the send api.
In the documentation of the send api, its mentioned as recipient.phone_number or recipient.id must be set. the api works with the recipient.id but when I am using the recipient.phone_number field then the api throws an error.
Can anyone please help with using the send api with phone number?
Sample request:
https://graph.facebook.com/v2.6/me/messages?access_token="ACCESS_TOKEN"
Request Body:
{
"recipient":{
"phone_number ": "my phone number"
},
"message":{
"text":"hello! how are you"
}
}
Response:
{
"error": {
"message": "(#100) Invalid keys \"phone_number \" were found in param \"recipient\".",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "GwOUYLfiR/A"
}
}
My app is in the developer mode and my phone number has been added to my facebook profile and verified.
As Tokenizer answered, you added a blank space in phone_number attribute name:
use "phone_number" instead of "phone_number ".
you have a blank space in phone_number attribute name.

Error with Twitter link

Yesterday I started a new app on Facebook. Today I got the message that when people copy the link to Twitter they get an error. This is what you get:
{
"error": {
"message": "Unknown path components: /your_namespace:your_action",
"type": "OAuthException",
"code": 2500
}
}
What does this mean? What could be the problem?
Are you actually sending the POST action link to Twitter? Why?
I think you misunderstood how Open Graph works. Basically, you should be the one publishing actions when users take an action using your service. You can use a server-side or a client-side language to POST request (when you click a link, your browser actually makes a GET request, not a POST) to https://graph.facebook.com/me/namespace:action?access_token=ACCESS_TOKEN&OBJECT_PATH=OBJECT_URL
Note that you need to create an app, use it to authenticate users to get the access token and also set your custom actions / objects. These will need to be approved before you can actually use them.
You should start by taking a look at the sample apps to see how they work: https://developers.facebook.com/docs/samples/