Why is payload URL optional in Facebook Send API - facebook

I am using the Facebook Send API and I wonder why the url property of message.attachment.payload is optional? I don't understand how you would send a file without specifying a URL, am I missing something or is this just an error in the docs?

As of writing this, there seems to be a missing field in the API table : you can specify a attachment_id to reuse a previously uploaded attachement.

Related

Bluemix API connect POST request (form data) file attachment issue

In API connect, I was working with one of the 'path' in API which requires file upload using multipart/form-data (POST request). I was not able to find out any support for it though.
While adding parameter there is no support for 'file' type (located-in: form-data). Is there something which I am missing in my setup? Is there any other way to attach file in request via API connect ?
I am using API Connect "Essentials" plan.
Thanks
I think that you can just leave the type blank:

Cloudinary Error: "Missing required parameter - file" via REST API

I'm just getting started with Cloudinary, and I'm attempting to Uploading with a direct call to the API. Using the DHC REST Client (chrome extension), I put my request together per the instructions found here at Creating API authentication signatures. Here's a screenshot of that request and response.
I also tried...
adding quotes around all values except timestamp as shown in the example
making the request a multi-part request and attaching the image to the body as a "file"
deleting timestamp, api_key, and signature and instead replacing them with upload_preset to try and upload an unsigned image (yes, I created the preset)
And finally, I did try adding public_id even though it says it would assign one if not provided.
In all cases, I get the same error response... Missing required parameter - file
Can anyone tell me what I'm missing?
Ok, figured it out. These name/value pairs need to be added to the body of the request rather than the header. Here's what that would look like in the DHC client. Note that the upload_preset will not work for you... I only created it to test with. Also note that doing a signed request is accomplished the same way but with different parameters.

Url parameter is required while making a call using Twilio API

I am trying to make calls using REST API and the Language I am using isn Apex.However,it is throwing me error saying 'Url parameter is required. For more information, see '
I am using Endpoint URL as follows :-
https://api.twilio.com/2010-04-01/Accounts//Calls.json?Url=http://demo.twilio.com/docs/voice.xml
If you see I am adding the Url param to the endpoint,still it is throwing me an error.
I am able to send SMS through Rest API,the issue is only when I am making calls.
Please suggest.
Thanks
Url must be POSTed to the API, you are now sending it as a GET parameter.
Change your code so that it does a POST instead of a GET and sent the Url parameter as a POST variable.
(see http://www.twilio.com/docs/api/rest/making-calls#post-parameters)
Also you left out the {AccountSid} in your URL, that's required as well. Of course you may have left it out because you don't want it publicly visible on SO, but I can't from here that that's your reason ;)

Facebook server-side OAuth 2.0 on localhost:8080 can't get access token missing redirect_uri

There are many other question related to this, but they didn't help me fix my problem.
I'm using the Facebook server-side login for a website, which I want to test locally. The path that initiates the login action is [http://localhost:8080/fblogin] (this redirects to the Facebook login dialogue, and goes from there).
I can successfully get the code, but when I try to exchange that for an access token, I get the following error:
{"error":{"message":"Missing redirect_uri parameter.","type":"OAuthException","code":191}}
I am providing the redirect_uri, url encoded and it is the same as the one I use to get the first code. Here is the url I'm using to request the access token (with the all-caps query string parameters replaced with their actual values, of course):
https://graph.facebook.com/oauth/access_token?client_id=CLIENT_ID&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Ffblogin&client_secret=CLIENT_SECRET&code=CODE_FROM_FB
I suspect this might have to do with how my app is set up on Facebook. Here are the values I have set:
Display Name: (an actual display name here)
App Domains: localhost
Contact email: (an actual email here)
Site URL: [http://localhost:8080/fblogin]
What do I need to tweak in the settings to get this to work? Or does this look correct?
By the way, if it makes any difference, I am using the Play! framework, version 2.0.1
After digging around a little more, I found that it was necessary for me to use POST when sending the request from my server to get the access token.
Interesting that using POST worked for you as this didn't for me.
In any case, did you add the query parameters using setQueryParameter()? (see How to make multiple http requests in play 2?)

Access Public Skydrive Content Using Live Connect REST Without Access Token

According to this Microsoft api page
http ://msdn.microsoft.com/en-us/library/live/hh826522#reading_albums
, I tried to translate this browser access skydrive URL
https://skydrive.live.com/?cid=0A263A7CBEAAFB80&sc=photos#cid=0A263A7CBEAAFB80&id=A263A7CBEAAFB80%214521&sc=photos
to
http://apis.live.net/v5.0/folder.0A263A7CBEAAFB80.A263A7CBEAAFB80!4521
Since the album is shared to public, I should be allowed to access without access token.Am I missed something? Or is just using the wrong URL?
I notice I can get public profile by using this
https ://apis.live.net/v5.0/0A263A7CBEAAFB80/
And I have read the REST API
http ://msdn.microsoft.com/en-us/library/live/hh243648.aspx
, but I found it is hard to deduce the correct url format
This get all albums
https ://apis.live.net/v5.0/0A263A7CBEAAFB80/albums
REST URL also fails.
I've been looking for a guide for this as well, but just noticed that your URL appears to have an additional '/' in it. The one listed on the site is:
https://apis.live.netv5.0/%fileid%
Were you able to get this to work?