LINKEDIN api : Invalid file name while uploading the photo url - postman

For posting multiple photos, I need to upload the photos with the following api
https://api.linkedin.com/media/upload
passing image through url. But getting the above error

As it accepts multipart/form-data, Need to change the type to file.

Related

serving user content/images from amazon s3

I am building an app which lets users upload pictures and share it with his/her friends only.
I am using spring restful services to upload content directly to s3.
The user is authorized using OAuth.
To upload an image an authorized user's js client invokes POST /images/{userid}
To download the image, the client has to invoke GET /images/{userid}/{imageid}
Each user's content is stored in s3 under his own folder name, and the downloading service as explained in point 4 is the one that has to be invoked. Unfortunately, this means I cannot assign this url as source to an image tag <img src="">, because the authorization token should be sent on GET request. I cannot make the contents of user folder public because only user and his friends are allowed to see the images. The current service will soon become a bottleneck and I would like to avoid that.
What is the recommended architecture/design to solve this problem?
Instead of having a service that loads and returns the entire image file from S3, you should have a service that simply generates an S3 presigned URL. Then the URL retrieved from that service can be used in the <img src=""> tags on your site. This will be much more performant since the web browser will ultimately download the image directly from S3, while also still being secure.
The flow for downloading the images would be like this
User invokes GET request to download image
At Server End
Authenticate user
Query DB for metadata
Create a time based auth token.
Create a image URL(S3 based) and append auth token created in previous step
At the client end(User browser) redirect user to new URL(this url is effectively S3 location+auth token )
Now direct request will comes at the server( image URL+ auth token)
authenticate the token and then show image to user
Above URL will not be valid for long time , but your images are secured. As auth token is time based it will cater your case like if some one make the image private/public remove a friend.Deleted images , Copy paste of image url etc ..

Not able to load the Image from facebook response

I'm using Auth0 api for login. I have received facebook response in which user profile picture is as below:-
https://lookaside.facebook.com/platform/profilepic/?asid=1324218274262199&height=50&width=50&ext=1525319136&hash=AeSrHdLSZSZhBkyQ
But when I'm trying to refer this image as below, I'm not able to retrieve the image.
<img src="https://lookaside.facebook.com/platform/profilepic/?asid=1324218274262199&height=50&width=50&ext=1525319136&hash=AeSrHdLSZSZhBkyQ">
Any can give me any expert advice why its happening.? I'm not able to find any related docs.
You should use the image by calling the picture attribute from your user object. So for example, we can use the access_token we receive upon authentication to call the /userinfo endpoint to get the user profile (this information is returned as a JSON object) at which point we can do something like userProfile.picture. If you are still having trouble can you please share your code?

How to send mail using gmail rest api from postmnan native application

My requirement is that send an email to some recipient with text body using POSTMAN Native app,
I used the below endpoint with requested data,
Base URL: https://www.googleapis.com/gmail/v1/users/userId/messages/send
Headers :Authorization:Bearer
Request Method :POST
Request body :{"raw";"to:user1mail#gmail.com","subject":"Test_Mail"}
Clicking Send button
But getting error response code 400,required recipient address
Please help me in this to send an email using POSTMAN,and I've tried with upload end point too -https://www.googleapis.com/upload/gmail/v1/users/user1email#gmail.com/messages/send
Thanks in advance,looking for help guys
Came across your question trying to figure this out myself today.
Request body : {"raw";"to:user1mail#gmail.com","subject":"Test_Mail"}
The raw param should be a complete email message that's base64-encoded.
i.e.: {"raw": "VG86IHVzZXIxbWFpbEBnbWFpbC5jb20KU3ViamVjdDogVGVzdF9NYWls"}
400 error means bad request, which could mean there are missing or wrong parameters. Check the Users.messages.send
Path parameters
userId string The user's email address. The special value me can be
used to indicate the authenticated user.
Required query parameters
uploadType string The type of upload request to the /upload URI.
Acceptable values are:
media - Simple upload. Upload the media only, without any metadata.
multipart - Multipart upload. Upload both the media and its metadata, in a single request.
resumable - Resumable upload. Upload the file in a resumable fashion, using a series of at least two requests where the first
request includes the metadata.

How to specify the name of uploaded to using REST API with uploadType=Media

I am using REST API to upload a file to the google drive. I know the name of the file to upload to and its id.
On the request URL line I was not able to find a way to specify the receiving file name or Id.
Post https://www.googleapis.com/upload/drive/v3/files?uploadType=media
Is there any way to set the name or fileId of the file in the request header?
Thank you

How to upload photo to Facebook via graph api

i am having a desktop application. My requirement is to upload photo to facebook using graph api. I am able to post message to user wall via application. But i am not able to upload photo. i am getting an error "EXPECTS UPLOAD FILE" . i went through the documentation specified in the link
http://developers.facebook.com/blog/post/498/
I am using Winhttp for the connection. So how the file name will be specified? Whether the file name be specified in the URL itself?'
Please help me out
Specify the paraemeters message and source as multipart/form-data and send it with winhttpsendrequest