INVALID_ENCRYPTED_ID when trying to get invoice details - paypal

Using the /v1/invoicing/invoices/invoice_id API in the PayPal Sandbox to retrieve invoice information, I am getting the following error no matter which invoice I use:
{
"name": "INVALID_ENCRYPTED_ID",
"message": "Invalid encrypted id",
"information_link": "https://developer.paypal.com/docs/api/invoicing/#errors",
"debug_id": "c64c84ba18ede",
"details": [{
"error_code": "27"
}
]
}
I have tried other APIs such as creating an invoice, sending an invoice, etc and they all work fine with the same credentials.
I can't find any mention of this error anywhere on PayPal or using Google.
Any ideas? Thanks!

The issue was I was using the invoice number, not the invoice ID.

Related

Facebook API Lead retrieval for internal business app should i submit for App Review

I am building a dedicated CRM solution and it is supposed to show the list of Facebook leads of the client and then convert manually it to internal lead . I am managed to setup a websocket client and Facebook is sending me lead details including leadgen_id.
{
"object":
"page" ,
"entry": [{
"id": "*****" ,
"time": 1627211279 ,
"changes": [{
"value": {
"form_id": "******" ,
"leadgen_id": "******" ,
"created_time": 1627211277 ,
"page_id": "******"} ,
"field": "leadgen"}
]}
]}
Then i have created an user access_token using Facebook's graph api and requested for the details of the leadgen_id using api endpoint
https://graph.facebook.com/v11.0/<LEADGEN_ID>?access_token=<ACCESS_TOKEN>
I was able to get the details of the test lead I created with the Facebook 's lead testing tool. But when accessing the production leadgen_id I am getting an exception with following as response.
{
"error": {
"message": "Unsupported get request. Object with ID '<LEADGEN_ID' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"error_subcode": 33,
"fbtrace_id": "*********"
}
}
Then I have tried using a system user token and its not even working for the test leads. In some part of documentation it is saying that I need to complete App review to access live data using lead_retrieval and in some other part of documentation its quoted that I don't need app review to use API for internal users . And I don't get the point of creating a 'login with Facebook' for this internal app specific for one user .
Is there anyway other way than completing app review to access lead details using leadgen_id ?
Its turns out I need to complete the app review specifying it as a 'Server to server app' on the review description, which doesn't need any Login with facebook button . Got the idea from https://developers.facebook.com/docs/app-review/resources/sample-submissions/server-to-server/

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.

all_trips Webhooks: Find out which user the status_changed is for

I've got the Webhooks working for our developer accounts, and it emits a status_changed message every time there is an Uber request, even if the request was not initiated from our app (using the "all_trips" permission)
When we get the response back, how do we determine which user this is for? E.g. in the response below, there is no way to determine that and using the server token to authenticate to the resource_href gives an "Invalid OAuth 2.0 credentials provided" error.
{
"event_id": "3a3f3da4-14ac-4056-bbf2-d0b9cdcb0777",
"event_time": 1427343990,
"event_type": "all_trips.status_changed",
"meta": {
"resource_id": "2a2f3da4",
"resource_type": "request",
"status": "accepted"
},
"resource_href": "https://api.uber.com/v1/requests/2a2f3da4"
}
Thanks for catching this! We rolled out a fix that adds the users UUID as an additional field in the "meta" section, as well as updated our documentation here: https://developer.uber.com/docs/webhooks
Let us know if you have any more trouble!

Paypal adaptive payment method for Paypal account verification

Any one can help for Paypal adaptive payment method for Paypal account verification. When we go to live mode and generate Live APP Id it is showing error:
{
"responseEnvelope": {
"timestamp": "2015-09-18T02:23:23.202-07:00",
"ack": "Failure",
"correlationId": "4321940d358d5",
"build": "18018453"
},
"error": [
{
"errorId": "560022",
"domain": "PLATFORM",
"subdomain": "Application",
"severity": "Error",
"category": "Application",
"message": "The X-PAYPAL-APPLICATION-ID header contains an invalid value",
"parameter": [
"X-PAYPAL-APPLICATION-ID"
]
}
]
}
I have found answer of Paypal adaptive payment and check paypal valid email or not.
When create an App, need to fill complete information of APP and if you want to check only Paypal email exist or not. Deselect 'Chained Payments' within your App Submission.
Paypal can allow you to use GrtVerifiedStatus. However, please ensure to set the 'matchCriteria' parameter to 'NAME' as the permission to use 'NONE' is highly restricted.

Can't get Facebook user id by Graph

I'm working on an iOS app and noticed that one user is not loaded when I do a requestForMyFriends.
After looking more into this it seems that the Graph API explorer also doesn't return anything for the particular Facebook user. It's a user and not a Fanpage or something.
So:
I've the page for example (which when I enter In my browser will bring up the Page nicely): https://www.facebook.com/user-name
https://graph.facebook.com/https://www.facebook.com/user-name
Will return:
{
id: "https://www.facebook.com/user-name"
}
https://graph.facebook.com/user-name
Will return:
{
error: {
message: "Unsupported get request.",
type: "GraphMethodException",
code: 100
}
}
http://findmyfacebookid.com/ wil return nothing.
The graph API will return:
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
I'm trying to reproduce this with my test Facebook account and put all restrictions to the max but I always get a nice result with a FacebookId.
My question:
What settings do I need to change to my test Facebook account to reproduce this problem?
"Unsupported GET Request" covers many situations, but at the root the message means you tried to request something via the API which is not available to you via the API
For a request which attempts to retrieve data about a known username or user ID the most likely reasons are:
User has blocked your app
User has disabled all platform apps in their privacy settings
User has deactivated their account
User has deleted their account
if i had to bet, I'd say it's the second one in this case
The problem is the parameter, you don't have to pass in the whole URL of a profile, just the username/profile-id.
For example: we want to get the info of Mark Zuckerberg. His Facebook username is zuck. The URL would be https://graph.facebook.com/zuck and will return the following output
{
"id": "4",
"name": "Mark Zuckerberg",
"first_name": "Mark",
"last_name": "Zuckerberg",
"link": "http://www.facebook.com/zuck",
"username": "zuck",
"gender": "male",
"locale": "en_US"
}
Using https://graph.facebook.com/4 (4 is the profile id of Mark Zuckerberg) would produce the same output.
Edit
After some further investigation it turned out that said user might have deactivated her account and that is why you see this error. I have used a testuser of one of my apps, went to Settings -> Security -> Deactivate my account and taxa, every request to the Graph API returned the result you're seeing.