Giter Club home page Giter Club logo

byob's Introduction

API of Curiosity Rovers Photos Taken on Sol 1500

Documentation

To get a JWT that allows access to POST, PATCH, and DELETE requests, please go to '/' and fill out the form with a turing.io email address and an app name.

GET ENDPOINTS

To receive a JSON object of camera data

GET /api/v1/cameras

Sample response:

{
  "cameras": [
    {
      "id": 5838,
      "name": "NAVCAM",
      "full_name": "Navigation Camera",
      "rover_id": 5,
      "nasa_id": null,
      "created_at": "2018-02-08T22:59:43.683Z",
      "updated_at": "2018-02-08T22:59:43.683Z"
    },
    {
      "id": 5839,
      "name": "MAST",
      "full_name": "Mast Camera",
      "rover_id": 5,
      "nasa_id": null,
      "created_at": "2018-02-08T22:59:43.683Z",
      "updated_at": "2018-02-08T22:59:43.683Z"
    }
  ]
}   

To receive a JSON object of photo data

GET /api/v1/photos

Sample response:

{
  "photos": [
    {
      "id": 176255,
      "img_src": "http://mars.jpl.nasa.gov/msl-raw-images/msss/01500/mcam/1500ML0076030010603940E01_DXXX.jpg",
      "earth_date": "2016-10-25",
      "sol": 1500,
      "nasa_id": 594011,
      "cameras_id": 5839,
      "created_at": "2018-02-08T22:59:43.737Z",
      "updated_at": "2018-02-08T22:59:43.737Z"
    },
    {
      "id": 176269,
      "img_src": "http://mars.jpl.nasa.gov/msl-raw-images/msss/01500/mcam/1500MR0075980060404383E01_DXXX.jpg",
      "earth_date": "2016-10-25",
      "sol": 1500,
      "nasa_id": 594027,
      "cameras_id": 5839,
      "created_at": "2018-02-08T22:59:43.740Z",
      "updated_at": "2018-02-08T22:59:43.740Z"
    },
  ]
}

To receive a JSON object of photos that one camera has taken

GET /api/v1/cameras/:cameraID/photos

Sample response:

{
  "photos": [
    {
      "id": 176328,
      "img_src": "http://mars.jpl.nasa.gov/msl-raw-images/proj/msl/redops/ods/surface/sol/01500/soas/rdr/ccam/CR0_530653019PRC_F0582136CCAM02500L1.PNG",
      "earth_date": "2016-10-25",
      "sol": 1500,
      "nasa_id": 593995,
      "cameras_id": 5840,
      "created_at": "2018-02-08T22:59:43.751Z",
      "updated_at": "2018-02-08T22:59:43.751Z"
    },
    {
      "id": 176331,
      "img_src": "http://mars.jpl.nasa.gov/msl-raw-images/proj/msl/redops/ods/surface/sol/01500/soas/rdr/ccam/CR0_530650354PRC_F0582136CCAM01500L1.PNG",
      "earth_date": "2016-10-25",
      "sol": 1500,
      "nasa_id": 594000,
      "cameras_id": 5840,
      "created_at": "2018-02-08T22:59:43.751Z",
      "updated_at": "2018-02-08T22:59:43.751Z"
    },
  ]
}

To receive a JSON object of one photo in particular

GET /api/v1/photo?{nasa_id}

Parameters:

Name Type Description
nasa_id integer To find a valid nasa_id, GET /api/v1/photos

Sample response:

{
  "photo": {
    "id": 176260,
    "img_src": "http://mars.jpl.nasa.gov/msl-raw-images/msss/01500/mcam/1500MR0076020040404393E01_DXXX.jpg",
    "earth_date": "2016-10-25",
    "sol": 1500,
    "nasa_id": 594013,
    "cameras_id": 5839,
    "created_at": "2018-02-08T22:59:43.738Z",
    "updated_at": "2018-02-08T22:59:43.738Z"
  }
}

Post Endpoints (JWT Authorization Required):

POST /api/v1/cameras

Send your JWT in the header of the request with the key "token".

Send the following parameters in the body:

Name Type Description
name string Name of the new camera
full_name string Full name of the new camera

Sample response:

{
    "id": 100
}

POST /api/v1/photos

Send your JWT in the header of the request with the key "token".

Send the following parameters in the body:

Name Type Description
img_src string Path of the image
earth_date string When the photo was taken
sol integer Martian days since Curiosity landed
nasa_id integer Nasa ID of the photo

Sample response:

{
    "id": 100
}

Patch Endpoints (JWT Authorization Required):

PATCH /api/v1/cameras/:cameraID

Send your JWT in the header of the request with the key "token".

Send the parameter you would like to update in the body of the request.

Sample response:

{
    "success": "Updated camera 5838's name."
}

PATCH /api/v1/photos/:photoID

Send your JWT in the header of the request with the key "token".

Send the parameter you would like to update in the body of the request.

Sample response:

{
    "success": "Updated photo 176255's earth_date."
}

Delete Endpoints (JWT Authorization Required):

DELETE /api/v1/photos/:id

Send your JWT in the header of the request with the key "token". Returns a 204 status code.

DELETE /api/v1/cameras/:id

Send your JWT in the header of the request with the key "token". Returns a 204 status code.

byob's People

Contributors

katiescruggs avatar jasonhughes1 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.