PicUp It API explained

what is an api?

PicUp API is an application programming interface which allows you to create your own application using PicUp platform as a backend. To seehow it works you can try FirefoxOS proof of concept application: https://github.com/PicUpIt/picup-ffos

Protocol

PicUp API is using regular HTTP GET/POST communication. Authentication tokens - if needed - (username - email and api_key) are passed as POST keys (email and api_key).

API Credentials

To get your api_key please login and go to your DeerBox.

Implemented calls
Get user
/api/user/ID

Example

$ curl https://picup.it/api/user/2/

  {"username": "bluszcz", 
    "pictures": [
      {"id": 29, "thumb": "/media/thumbs/776724ac47cb8e9cf5a6053e93757065_5.jpg"}, 
    "galleries": [
      {"thumb": "/media/thumbs/be609302a10c5c1f4fde9210f9a83523_3.jpg", "user_id": 2, 
        "id": 1, "title": "PicUp progress"}, [...]
Get gallery

Example

$ curl https://picup.it/api/gallery/2/

  {"thumb": "/media/thumbs/fc9993b9a523624a71cd4b5717eb3446_3.jpg", 
    "pictures": [
      {"id": 120, "thumb": "/media/thumbs/b203a03aca3aad99e18c2b72f0521ced_3.jpg"}, 
      {"id": 121, "thumb": "/media/thumbs/018a35ca3c66b297438c9af133c90174_3.jpg"}, 
      {"id": 118, "thumb": "/media/thumbs/fc9993b9a523624a71cd4b5717eb3446_3.jpg"}, [...]
Get picture
/api/picture/ID

Example

$ curl https://picup.it/api/picture/666/
  
  {"id": 666, "thumb": "/media/thumbs/378f4fac571dea131df81972f41e9176.jpg"}
Get recommended galleries and users
/api/browse/

Example

$ curl https://picup.it/api/browse/

  {"galleries": [
    {"thumb": "/media/thumbs/98f1c2067b483e25e8c77ab3c919ad8f.jpg", 
      "user_id": 2, "id": 77, 
      "title": "Warsaw, Poland 2012"}, 
    {"thumb": "/media/thumbs/8a24e2476794b000ec56894fb01f3236.jpg", 
      "user_id": 2, "id": 76, 
      "title": "Frida Kahlo, Podkowa Lesna, Poland 2012"}, 
    {"thumb": "/media/thumbs/4c4fc2113229bed61b3ba6f13938c127.jpg", 
      "user_id": 34, "id": 69, "title": "EXTREMA @ FRT"},  [...]
  {users": [
    {"username": "pikkulintu", "id": 55, 
      "thumb": "/media/thumbs/12382412bb5e6078ebec81da111515e9.jpg"}, 
    {"username": "yves.marechal.1978", "id": 52, 
      "thumb": "/media/thumbs/11560dd19e139b1ce329fa5f33d88186.jpg"}, [...]
Get recommended galleries
/api/browse/galleries/

Example

$ curl https://picup.it/api/browse/galleries/

  {"galleries": [
    {"thumb": "/media/thumbs/98f1c2067b483e25e8c77ab3c919ad8f.jpg", 
      "user_id": 2, "id": 77, "title": "Warsaw, Poland 2012"}, 
    {"thumb": "/media/thumbs/8a24e2476794b000ec56894fb01f3236.jpg", 
      "user_id": 2, "id": 76, "title": "Frida Kahlo, Podkowa Lesna, Poland 2012"}, 
    {"thumb": "/media/thumbs/84d46de6e69f23b7f18582009f37c50a_1.jpg", 
      "user_id": 2, "id": 75, "title": "Books"},  [...]
Get recommended users
/api/browse/users/

Example

$ curl https://picup.it/api/browse/users/

  {users": [
    {"username": "pikkulintu", "id": 55, 
      "thumb": "/media/thumbs/12382412bb5e6078ebec81da111515e9.jpg"}, 
    {"username": "yves.marechal.1978", "id": 52, 
      "thumb": "/media/thumbs/11560dd19e139b1ce329fa5f33d88186.jpg"}, [...]
Test of authentcation
/api/auth/

Example

$ curl -F username=username@example.com \
     -F api_key=2323232323 \
     https://piciup.it/api/auth/
{"status": "OK"}
Upload of the picture
/api/upload/

Example

$ curl -F picture=@launchpad.jpg \
    @launchpad.jpg \
     -F api_key=2323232323 \
     https://piciup.it/api/upload/
{"status": "OK"}

Support / help

Please ask on Diaspora* social network with hashtag #picup.

More methods and documentation are coming soon.