PhotoUploads Developer API

API call

Request method

PhotoUploads API  calls can be done using the POST or GET request methods but since GET request are limited by the maximum allowed length of an URL you should prefer the POST request method.

Request URL

http://photouploads.com/api/1/<action>/

Parameters

  • key The API key, can be requested from our Cotact Form. Just request the key and let us know how you plan on using it.
  • action What you want to do [values: upload].
  • source Either a image URL or a base64 encoded image string. You can also use FILES["source"] in your request.
  • format Sets the return format [values: json (default), redirect, txt].

Example call

GET http://photouploads.com/api/1/upload/?key=12345&source=http://somewebsite/someimage.jpg&format=json

Note: Always use POST when uploading local files. Url encoding may alter the base64 source due to encoded characters or just by URL request length limit due to GET request.

API response

PhotoUploads API responses will vary depending on the format parameter:

  • json Display all the image uploaded information in JSON format. [default]
  • txt Returns the image direct URL in text/plain format.
  • redirect Redirects to the image viewer URL.

When using JSON the response will have headers status codes to allow you to easily notice if the request was OK or not. It will also output the status_txt and status_code properties.

Example response (JSON)

{
		"status_code": 200,
		"success": {
			"message": "image uploaded",
			"code": 200
		},
		"image": {
			"name": "example",
			"extension": "png",
			"size": 53237,
			"width": 1151,
			"height": 898,
			"date": "2014-06-04 15:32:33",
			"date_gmt": "2014-06-04 19:32:33",
			"storage_id": null,
			"description": null,
			"nsfw": "0",
			"md5": "c684350d722c956c362ab70299735830",
			"storage": "datefolder",
			"original_filename": "example.png",
			"original_exifdata": null,
			"views": "0",
			"id_encoded": "L",
			"filename": "example.png",
			"ratio": 1.2817371937639,
			"size_formatted": "52 KB",
			"mime": "image/png",
			"bits": 8,
			"channels": null,
			"url": "http://127.0.0.1/images/2014/06/04/example.png",
			"url_viewer": "http://127.0.0.1/image/L",
			"thumb": {
				"filename": "example.th.png",
				"name": "example.th",
				"width": 160,
				"height": 160,
				"ratio": 1,
				"size": 17848,
				"size_formatted": "17.4 KB",
				"mime": "image/png",
				"extension": "png",
				"bits": 8,
				"channels": null,
				"url": "http://127.0.0.1/images/2014/06/04/example.th.png"
			},
			"medium": {
				"filename": "example.md.png",
				"name": "example.md",
				"width": 500,
				"height": 390,
				"ratio": 1.2820512820513,
				"size": 104448,
				"size_formatted": "102 KB",
				"mime": "image/png",
				"extension": "png",
				"bits": 8,
				"channels": null,
				"url": "http://127.0.0.1/images/2014/06/04/example.md.png"
			},
			"views_label": "views",
			"display_url": "http://127.0.0.1/images/2014/06/04/example.md.png",
			"how_long_ago": "moments ago"
		},
		"status_txt": "OK"
	}

Example response (txt)

http://127.0.0.1/images/2014/06/04/example.png

API user upload workaround

PhotoUploads API one doesn't have a way to upload images associated with a given user but PhotoUploads will ba able to do this on a case by case basis Cotact Us with details how you plan on implimenting this.

이미지 미리보기를 클릭하면
이미지를 편집하거나 사이즈를 조절할 수 있습니다.
이미지 미리보기를 탭하면
이미지를 편집하거나 사이즈를 조절할 수 있습니다.
업로드 중 0 이미지 (0% 완료)
대기열을 업로드하고 있습니다. 완료하는데 몇 초밖에 걸리지 않습니다.
업로드가 완료되었습니다
업로드한 게시물이 앨범에 추가되었습니다. 업로드된 게시물은 새 앨범 만들기를 할 수 있습니다.
업로드한 게시물이 앨범에 추가되었습니다.
업로드된 게시물은 새 앨범 만들기를 할 수 있습니다. 계정에 이 게시물을 저장하려면 계정 만들기 또는 로그인 해야 합니다.
이미지이(가) 업로드되지 않았습니다
Some errors have occurred and the system couldn't process your request.
    참고: 일부 이미지를 업로드하지 못했습니다. 더 알아보기
    자세한 내용은 오류 보고서를 참고해주세요.
    JPG PNG BMP GIF 10 MB