Due to the May 2015 updates my application cannot use the login with LinkedIn option, this is the snippet I'm using:
$linkedinService->request('/people/~:(first-name,last-name,email-address)?format=json')
When I use the web console it returns the correct data, but if I dump the result from the app I get this:
array (size=5)
'errorCode' => int 0
'message' => string 'Unknown field {~%3A%28first-name%2Clast-name%2Cemail-address%29} in resource {Root}' (length=83)
'requestId' => string 'asdfghjk' (length=10)
'status' => int 400
'timestamp' => int 1435742730817
Update:
The exact curl request is: (with access token)
https://api.linkedin.com/v1//people/~%3A%28first-name%2Clast-name%2Cemail-address%29?format=json&oauth2_access_token=
If I paste that in the web console I get
Could not find person based on: ~%3A%28first-name%2Clast-name%2Cemail-address%29
But if I urldecode it first and paste it in it returns the correct data
Hi I got the same problem. I find out that it is URL Problem. In request uri don't use // double slash like you did in your example m/v1//people/.
I know its been you have posted here but someone else can get benefit of it.
Related
The title is the Paypal NVP API's error message. API is TransactionSearch.
In my PHP code, if I set the search parameters "STATUS" => "Reversed", The API return this result:
'TIMESTAMP' => '2016-03-23T02:32:41Z',
'CORRELATIONID' => '77fcf63ee550e',
'ACK' => 'SuccessWithWarning',
'VERSION' => '109.0',
'BUILD' => '18316154',
'L_ERRORCODE0' => '11002',
'L_SHORTMESSAGE0' => 'Search warning',
'L_LONGMESSAGE0' => 'The number of results were truncated. Please change your search parameters if you wish to see all your results.',
'L_SEVERITYCODE0' => 'Warning'
But, If I not add the search parameters "STATUS", API return success!
so, I want to know how to set search parameters that I can get right result with "STATUS" => "Reversed"
do you have many reversed transactions? I ask because the maximum number of transactions that can be returned from a TransactionSearch API call is 100. In this case looks like the API response has more than 100 hits. Try to reduce the data range or look for other status and see if you still get the error. Anyway here you can find the technical reference guide for this API: https://developer.paypal.com/docs/classic/api/merchant/TransactionSearch_API_Operation_NVP/
I have a running workflow which I would like to post fields to via an API call (see below):
$ret = invokeFlowgear(
"https://domain.flowgear.io/salesbooks",
"username",
"password",
30,
array(
'name' => 'Introduction to Data integration with Flowgear',
'isbn' => 'X-XXX-XXXX',
'qis' => 0,
'price' => 250.99,
'author_id' => 3
)
);
Eventually this call should result into the workflow inserting the data onto the table and returning a success message.
What do I need to have this achieved with a workflow via an API?
You need to accept the raw HTTP POST body into the Workflow. To do that, set an appropriate URL ("/salesbooks/") in the workflow detail pane and set the method to POST.
Then drop in a Variable Bar and add the special property FgRequestBody. Optionally also add FgRequestContentType so you can inspect the content type of the message being received.
Create an HTTP POST to that Workflow and you can see what's coming through to the FgRequestBody property (it will show in the Start entry in the activity logs).
If you need to convert between JSON and XML, using JSON Convert.
I'm using old Vimeo API, and I'd like to move on new OAuth2 API.
But I can't figure how to get my videos list, using /me/videos entry point.
API always returns me an empty result:
array (size=3)
'body' => null
'status' => int 0
'headers' => array (size=0) empty
I'm using new Vimeo PHP SDK (https://github.com/vimeo/vimeo.php) like this way:
<?php
$vimeo = new Vimeo($clientId, $clientSecret);
$response = $vimeo->clientCredentials();
$vimeo->setToken($response);
die(var_dump($vimeo->request('/me/videos')));
Of course I have a video test in my account, in public mode.
Any idea to get out of this behavior?
Many thanks for your help,
Philippe
the php api you wanted to use is not for oauth2 integration. You should check related instructions on vimeo's developer site.
I just don't know why this fails. I have the following which attempts to add tasks to Asana:
$arrayOfIds = array("0123456789", "9876543210");
$followers = implode('", "', $arrayOfIds);
$newtask = $asana->createTask(array(
"workspace" => $workspaceId,
"name" => $name,
"team" => $teamId,
"assignee" => $assignee,
"due_on" => $dueOn,
"completed" => $completed,
"completed_at" => $completedAt,
//"followers" => array("0123456789")
"followers" => array($followers)
));
It works just fine when I put the user ID in manually, like above commented code, however fails when I try to use the array. I get the following error:
Error while trying to connect to Asana, response code: 400
Any help is greatly appreciated.
Without knowing exactly how the $asana lib is implemented (link?) my guess would be that the array is not encoded correctly. If sent via url-encoded post data (as opposed to JSON) the array should be comma-delimited. PHP may do something else like followers[]=1&followers[]=2 when it should be followers=1,2.
Try doing something like "followers" => implode(",", $arrayOfIds), or check the code of the library to see how it encodes arrays. Additionally, including the actual HTTP request/response would help figure out what's going in. There are many ways to get this - your library may include a verbose/debugging mode, but if all else fails you can always use something like Charles Proxy, Wireshark, Ettercap, etc.
Using PHP 5.2.11 and the new facebook graph code...
If I call
$facebook->api("/me");
I get a proper response:
array
'id' => string '10700210' (length=8)
'name' => string 'Brandon Renfrow' (length=19)
'first_name' => string 'Brandon' (length=7)
'middle_name' => string '✫' (length=3)
'last_name' => string 'Renfrow' (length=7)
'link' => string 'http://www.facebook.com/brenfrow' (length=32)
'about' => string 'Spiritual birthday: 1/22/2005' (length=29)
...
...
But if I call
$facebook->api("/me/picture");
I always get a response of:
null
Does anyone know why this is?
Well I guess the best answer I've found is to call http://graph.facebook.com/USER_ID?fields=picture to get the picture URL. Its to bad they don't document things like this on their API especially when its obvious this is broken for so many people.
As an addition to betaman's answer, you can pass the parameters in a separate array like so:
$aResponse = $oFacebook->api('/me', array(
'fields' => 'picture',
'type' => 'large'
));
You may not even need to do an API call... use this on your frontend:
<img src="//graph.facebook.com/USER_ID/picture?type=square" />
Read more here: http://developers.facebook.com/docs/reference/api/#pictures
There is an even simpler way, using the provided facebook api, just call:
$facebook->api("/me?fields=picture");
This will make your code simpler and more elegant.
While using $facebook->api("/me?fields=picture"); does work, you won't be able to pass parameters such as width or type. Instead try the following:
$facebook->api('/me/picture?redirect=false');
This worked for me and will also allow you to pass parameters.
I just went to my "/me/picture" in the browser and it redirected me to a static image on one of Facebook's CDN servers. Perhaps the redirect is throwing a wrench in your api call.