legacy-api-documentation
legacy-api-documentation copied to clipboard
Upload returns 404 response
Hi,
I'm trying to upload an image using the Upload API.. But I'm getting a 404 not found exception. Can anyone tell me what is wrong with my code??
using (var httpClient = httpClientHelperFactory.Create()) (wrapper for HttpClient) { var content = new MultipartFormDataContent { { new StringContent(photoId.ToString()), "photo_id"}, { new StringContent(uploadKey), "upload_key"}, { new ByteArrayContent(file),"file", fileName}, { new StringContent(consumerKey), "consumer_key"}, { new StringContent(token), "access_key"} }; var response = await httpClient.PostAsync( " http://upload.500px.com/v1/upload", content, cancellationToken).ConfigureAwait(false); }
Hi,
thanks for getting in touch!
Please refer to our documentation on uploads and make sure you're passing everything correctly: https://github.com/500px/api-documentation/blob/master/endpoints/upload/POST_upload.md
and let us know if that works!
Cheers, Martin
Hi,
thanks for the response. Using this endpoint, I'm receiving a 401 not Authorized exception. The documentation says its a beta endpoint. Could this be the reason for the 401 error?
Thanks, Arie