Skip to content

Instantly share code, notes, and snippets.

@RickCarlino
Last active Mar 7, 2017
Embed
What would you like to do?
Feb 2017

DELETE /api/device

Response

Empty Response

GET /api/device

Response

{
  "id": 36,
  "name": "conduplicate-grass-583",
  "webcam_url": "https://pigment.github.io/fake-logos/logos/medium/color/10.png"
}

PUT /api/device

Request

{
  "name": "Dexter Schinner"
}

Response

{
  "id": 52,
  "name": "Dexter Schinner",
  "webcam_url": "https://pigment.github.io/fake-logos/logos/medium/color/12.png"
}

GET /api/device

Response

{
  "id": 119,
  "name": "denticulate-star-586",
  "webcam_url": "https://pigment.github.io/fake-logos/logos/medium/color/2.png"
}

POST /api/device

Request

{
  "name": "seed-fog-926"
}

Response

{
  "id": 143,
  "name": "seed-fog-926",
  "webcam_url": null
}

GET /api/farm_events

Response

[
  {
    "id": 2,
    "start_time": "2017-03-03T00:00:00.000Z",
    "end_time": "2017-03-12T00:01:00.000Z",
    "next_time": null,
    "repeat": 4,
    "time_unit": "never",
    "executable_id": 11,
    "executable_type": "Sequence",
    "calendar": [

    ]
  },
  {
    "id": 1,
    "start_time": "2017-03-02T00:00:00.000Z",
    "end_time": "2017-03-10T00:01:00.000Z",
    "next_time": null,
    "repeat": 4,
    "time_unit": "monthly",
    "executable_id": 10,
    "executable_type": "Sequence",

POST /api/farm_events

**Notes: ** This is how you could create a FarmEvent that fires every4 minutes

Request

{
  "end_time": "2099-02-17T18:19:20.000Z",
  "executable_id": "47",
  "executable_type": "Sequence",
  "repeat": "4",
  "start_time": "2015-02-17T15:16:17.000Z",
  "time_unit": "minutely"
}

Response

{
  "id": 6,
  "start_time": "2015-02-17T15:16:17.000Z",
  "end_time": "2099-02-17T18:19:20.000Z",
  "next_time": "2017-03-07T21:10:49.847Z",
  "repeat": 4,
  "time_unit": "minutely",
  "executable_id": 47,
  "executable_type": "Sequence",
  "calendar": [

  ]
}

PATCH /api/farm_events/10

Request

{
  "farm_event": {
    "repeat": "66"
  }
}

Response

{
  "id": 10,
  "start_time": "2017-03-03T00:00:00.000Z",
  "end_time": "2017-03-11T00:01:00.000Z",
  "next_time": null,
  "repeat": 3,
  "time_unit": "monthly",
  "executable_id": 64,
  "executable_type": "Sequence",
  "calendar": [

  ]
}

DELETE /api/farm_events/8

Response

Empty Response

GET /api/images

Response

[
  {
    "id": 17,
    "device_id": 103,
    "attachment_processed_at": null,
    "updated_at": "2017-03-07T21:11:12.383Z",
    "created_at": "2017-03-07T21:11:12.383Z",
    "attachment_url": "https://farmbot-team.storage.googleapis.com/images/attachments/000/000/017/x640/fixture.jpg?1488921072",
    "meta": {
      "x": 1,
      "y": 2,
      "z": 3
    }
  },
  {
    "id": 16,
    "device_id": 103,
    "attachment_processed_at": null,
    "updated_at": "2017-03-07T21:11:11.243Z",
    "created

POST /api/images

Response

{
  "id": 19,
  "device_id": 105,
  "attachment_processed_at": null,
  "updated_at": "2017-03-07T21:11:22.268Z",
  "created_at": "2017-03-07T21:11:22.268Z",
  "attachment_url": "http://placehold.it/640%3Ftext=Processing...",
  "meta": {
    "x": 1,
    "y": 2,
    "z": 3
  }
}

GET /api/images/18

Response

{
  "id": 18,
  "device_id": 104,
  "attachment_processed_at": null,
  "updated_at": "2017-03-07T21:11:20.803Z",
  "created_at": "2017-03-07T21:11:20.803Z",
  "attachment_url": "https://farmbot-team.storage.googleapis.com/images/attachments/000/000/018/x640/fixture.jpg?1488921080",
  "meta": {
    "x": 1,
    "y": 2,
    "z": 3
  }
}

DELETE /api/images/20

Response

Empty Response

POST /api/logs

Response

[
  {
    "id": 11,
    "created_at": 1488921046,
    "message": "one",
    "meta": {
      "x": 1,
      "y": 2,
      "z": 3,
      "type": "info"
    },
    "channels": [
      "toast"
    ]
  },
  {
    "id": 12,
    "created_at": 1488921046,
    "message": "two",
    "meta": {
      "x": 1,
      "y": 2,
      "z": 3,
      "type": "info"
    },
    "channels": [
      "toast"
    ]
  },
  {
    "id": 13,
    "created_at": 1488921046,
    "message": "three",
    "meta": {
      "x": 1,
    

POST /api/logs

Response

[
  {
    "id": 19,
    "created_at": 1488921046,
    "message": "one",
    "meta": {
      "x": 1,
      "y": 2,
      "z": 3,
      "type": "info"
    },
    "channels": [
      "toast"
    ]
  },
  {
    "id": 20,
    "created_at": 1488921046,
    "message": "three",
    "meta": {
      "x": 1,
      "y": 2,
      "z": 3,
      "type": "info"
    },
    "channels": [

    ]
  }
]

POST /api/logs

Response

[
  {
    "id": 26,
    "created_at": 1488921046,
    "message": "one",
    "meta": {
      "x": 1,
      "y": 2,
      "z": 3,
      "type": "info"
    },
    "channels": [
      "toast"
    ]
  },
  {
    "id": 27,
    "created_at": 1488921046,
    "message": "one",
    "meta": {
      "x": 1,
      "y": 2,
      "z": 3,
      "type": "info"
    },
    "channels": [
      "toast"
    ]
  },
  {
    "id": 28,
    "created_at": 1488921046,
    "message": "one",
    "meta": {
      "x": 1,
      

POST /api/logs

Response

{
  "id": 46,
  "created_at": 1488921046,
  "message": "Hello, world!",
  "meta": {
    "x": 1,
    "y": 2,
    "z": 3,
    "type": "info"
  },
  "channels": [
    "toast"
  ]
}

GET /api/logs

Response

[
  {
    "id": 47,
    "created_at": 1488921047,
    "message": "e-enable clicks-and-mortar e-business",
    "meta": {
      "type": [
        "warn"
      ]
    },
    "channels": [
      "toast"
    ]
  },
  {
    "id": 48,
    "created_at": 1488921047,
    "message": "streamline bleeding-edge solutions",
    "meta": {
      "type": [
        "busy"
      ]
    },
    "channels": [
      "toast"
    ]
  },
  {
    "id": 49,
    "created_at": 1488921047,
    "message": "orchestrate turn-key fu

DELETE /api/logs/all

Response

Empty Response

POST /api/password_resets

Request

{
  "email": "jason_ziemann@friesenwolf.net"
}

Response

{
  "status": "Check your email!"
}

PUT /api/password_resets/eyJ0eXAiOiJKV1QiLCJhbGci

Request

{
  "password": "xpassword123",
  "password_confirmation": "xpassword123"
}

Response

{
  "token": {
    "unencoded": {
      "sub": "asa@anderson.biz",
      "iat": 1488921088,
      "jti": "2db61745-25d4-4d7a-845f-1d22b67f4291",
      "iss": "//localhost:3000",
      "exp": 1492377088,
      "mqtt": "blooper.io",
      "os_update_server": "http://blah.com",
      "fw_update_server": "http://test.com",
      "bot": "device_140"
    },
    "encoded": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhc2FAYW5kZXJzb24uYml6IiwiaWF0IjoxNDg4OTIxMDg4LCJqdGkiOiIyZGI2MTc0NS0yNWQ0LTRkN2EtO

POST /api/peripherals

Request

{
  "peripherals": [
    {
      "label": "LED",
      "mode": "0",
      "pin": "13"
    }
  ]
}

Response

[
  {
    "id": 1,
    "pin": 13,
    "mode": 0,
    "label": "LED"
  }
]

GET /api/peripherals

Response

[
  {
    "id": 5,
    "pin": 36,
    "mode": 1,
    "label": "MyString"
  },
  {
    "id": 4,
    "pin": 46,
    "mode": 1,
    "label": "MyString"
  }
]

DELETE /api/peripherals/2

Response

Empty Response

POST /api/plants

Request

{
  "icon_url": "/tiny-lettuce.png",
  "img_url": "/lettuce.png",
  "name": "My Lettuce",
  "openfarm_slug": "limestone-lettuce",
  "x": "23",
  "y": "45"
}

Response

{
  "id": 2,
  "x": 23,
  "y": 45,
  "radius": 50.0,
  "name": "My Lettuce",
  "img_url": "/lettuce.png",
  "icon_url": "/tiny-lettuce.png",
  "openfarm_slug": "limestone-lettuce",
  "created_at": "2017-03-07T21:10:40.421Z",
  "device_id": 9,
  "planting_area_id": null
}

PATCH /api/plants/1

Request

{
  "created_at": "2017-01-24T07:40:26.965-06:00",
  "icon_url": "/tiny-lettuce.png",
  "img_url": "/lettuce.png",
  "name": "My Lettuce",
  "openfarm_slug": "limestone-lettuce",
  "x": "23",
  "y": "45"
}

Response

{
  "id": 1,
  "x": 23,
  "y": 45,
  "radius": 50.0,
  "name": "My Lettuce",
  "img_url": "/lettuce.png",
  "icon_url": "/tiny-lettuce.png",
  "openfarm_slug": "limestone-lettuce",
  "created_at": "2017-01-24T13:40:26.965Z",
  "device_id": 2,
  "planting_area_id": null
}

DELETE /api/plants/3

Response

Empty Response

GET /api/points

Response

[
  {
    "id": 3,
    "x": 128.0,
    "y": 1.0,
    "z": 32.0,
    "radius": 1.5,
    "created_at": "2017-03-07T21:10:44.555Z",
    "meta": {
    }
  },
  {
    "id": 2,
    "x": 28.0,
    "y": 468.0,
    "z": 424.0,
    "radius": 1.5,
    "created_at": "2017-03-07T21:10:44.544Z",
    "meta": {
    }
  },
  {
    "id": 1,
    "x": 307.0,
    "y": 541.0,
    "z": 446.0,
    "radius": 1.5,
    "created_at": "2017-03-07T21:10:44.530Z",
    "meta": {
    }
  }
]

POST /api/points

Response

{
  "id": 4,
  "x": 1.0,
  "y": 2.0,
  "z": 3.0,
  "radius": 3.0,
  "created_at": "2017-03-07T21:10:44.914Z",
  "meta": {
    "foo": "BAR"
  }
}

PUT /api/points/5

Response

{
  "id": 5,
  "x": 99.0,
  "y": 87.0,
  "z": 33.0,
  "radius": 55.0,
  "created_at": "2017-03-07T21:10:45.953Z",
  "meta": {
    "foo": "BAR"
  }
}

DELETE /api/points/6

Response

Empty Response

DELETE /api/points/8,9,10,11,12,13

Response

Empty Response

POST /api/points/search

Response

[
  {
    "id": 14,
    "x": 354.0,
    "y": 278.0,
    "z": 378.0,
    "radius": 1.5,
    "created_at": "2017-03-07T21:11:38.186Z",
    "meta": {
      "foo1": "1"
    }
  }
]

GET /api/regimens

Response

[
  {
    "id": 2,
    "name": "65a9a332832ff2eb9dfbb32d4db94f72",
    "color": null,
    "device_id": 17,
    "regimen_items": [

    ]
  }
]

GET /api/regimens

Response

[

]

POST /api/regimens

Request

{
  "color": "red",
  "name": "Lapras Lapras Venonat",
  "regimen_items": [
    {
      "sequence_id": "50",
      "time_offset": "123"
    }
  ]
}

Response

{
  "id": 9,
  "name": "Lapras Lapras Venonat",
  "color": "red",
  "device_id": 124,
  "regimen_items": [
    {
      "id": 8,
      "regimen_id": 9,
      "time_offset": 123,
      "sequence": {
        "id": 50,
        "name": "Networked encompassing methodology",
        "color": "blue",
        "body": [

        ],
        "args": {
          "version": 4,
          "is_outdated": true
        },
        "kind": "sequence"
      }
    }
  ]
}

DELETE /api/regimens/5

Response

Empty Response

PUT /api/regimens/8

Request

{
  "color": "blue",
  "name": "something new",
  "regimen_items": [
    {
      "sequence_id": "18",
      "time_offset": "1555500000"
    },
    {
      "sequence_id": "18",
      "time_offset": "864300000"
    },
    {
      "sequence_id": "18",
      "time_offset": "950700000"
    }
  ]
}

Response

{
  "id": 8,
  "name": "something new",
  "color": "blue",
  "device_id": 54,
  "regimen_items": [
    {
      "id": 5,
      "regimen_id": 8,
      "time_offset": 1555500000,
      "sequence": {
        "id": 18,
        "name": "Public-key multi-state leverage",
        "color": "green",
        "body": [

        ],
        "args": {
          "version": 4,
          "is_outdated": true
        },
        "kind": "sequence"
      }
    },
    {
      "id": 6,
      "regimen_id": 8,
      "tim

GET /api/sequences

Response

[
  {
    "id": 6,
    "name": "Programmable methodical methodology",
    "color": "blue",
    "body": [

    ],
    "args": {
      "version": 4,
      "is_outdated": true
    },
    "kind": "sequence"
  },
  {
    "id": 5,
    "name": "Expanded 4th generation hub",
    "color": "red",
    "body": [

    ],
    "args": {
      "version": 4,
      "is_outdated": true
    },
    "kind": "sequence"
  }
]

POST /api/sequences

Response

{
  "id": 33,
  "name": "Scare Birds",
  "color": "gray",
  "body": [
    {
      "kind": "move_absolute",
      "args": {
        "location": {
          "kind": "coordinate",
          "args": {
            "x": 1,
            "y": 2,
            "z": 3
          }
        },
        "offset": {
          "kind": "coordinate",
          "args": {
            "x": 0,
            "y": 0,
            "z": 0
          }
        },
        "speed": 4
      }
    },
    {
      "kind": "move_absolut

POST /api/sequences

Response

{
  "id": 34,
  "name": "Scare Birds",
  "color": "gray",
  "body": [

  ],
  "args": {
    "is_outdated": false,
    "version": 4
  },
  "kind": "sequence"
}

POST /api/sequences

Response

{
  "id": 37,
  "name": "Scare Birds",
  "color": "gray",
  "body": [
    {
      "kind": "move_absolute",
      "args": {
        "location": {
          "kind": "coordinate",
          "args": {
            "x": 1,
            "y": 2,
            "z": 3
          }
        },
        "offset": {
          "kind": "coordinate",
          "args": {
            "x": 0,
            "y": 0,
            "z": 0
          }
        },
        "speed": 4
      }
    },
    {
      "kind": "move_absolut

POST /api/sequences

Response

{
  "id": 40,
  "name": "Scare Birds",
  "color": "gray",
  "body": [
    {
      "kind": "move_absolute",
      "args": {
        "location": {
          "kind": "coordinate",
          "args": {
            "x": 1,
            "y": 2,
            "z": 3
          }
        },
        "offset": {
          "kind": "coordinate",
          "args": {
            "x": 0,
            "y": 0,
            "z": 0
          }
        },
        "speed": 4
      }
    },
    {
      "kind": "move_absolut

PATCH /api/sequences/1

Response

{
  "id": 1,
  "name": "Scare Birds",
  "color": "purple",
  "body": [
    {
      "kind": "move_absolute",
      "args": {
        "location": {
          "kind": "coordinate",
          "args": {
            "x": 1,
            "y": 2,
            "z": 3
          }
        },
        "offset": {
          "kind": "coordinate",
          "args": {
            "x": 0,
            "y": 0,
            "z": 0
          }
        },
        "speed": 4
      }
    },
    {
      "kind": "move_absolu

GET /api/sequences/12

Response

{
  "id": 12,
  "name": "Seamless homogeneous superstructure",
  "color": "orange",
  "body": [

  ],
  "args": {
    "version": 4,
    "is_outdated": true
  },
  "kind": "sequence"
}

PATCH /api/sequences/3

Response

{
  "id": 3,
  "name": "Scare Birds",
  "color": "green",
  "body": [

  ],
  "args": {
    "version": 4,
    "is_outdated": false
  },
  "kind": "sequence"
}

DELETE /api/sequences/41

Response

Empty Response

GET /api/sync

Response

{
  "api_version": "8fa3eb1",
  "compat_num": 1,
  "device": {
    "id": 13,
    "planting_area_id": null,
    "name": "oval-surf-990",
    "webcam_url": "https://pigment.github.io/fake-logos/logos/medium/color/12.png",
    "max_log_count": 100,
    "max_images_count": 100
  },
  "users": [
    {
      "id": 11,
      "device_id": 13,
      "name": "Gregorio Gerhold",
      "email": "abel@heeldietrich.com",
      "created_at": "2017-03-07T21:10:40.607Z",
      "updated_at": "2017-03-07T21:10:40.

POST /api/tokens

Request

{
  "user": {
    "email": "addison@ferry.io",
    "password": "password"
  }
}

Response

{
  "token": {
    "unencoded": {
      "sub": "addison@ferry.io",
      "iat": 1488921039,
      "jti": "578ab321-46c8-4ce5-805f-4ebf1f4d538c",
      "iss": "//localhost:3000",
      "exp": 1492377039,
      "mqtt": "blooper.io",
      "os_update_server": "http://blah.com",
      "fw_update_server": "http://test.com",
      "bot": "device_1"
    },
    "encoded": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhZGRpc29uQGZlcnJ5LmlvIiwiaWF0IjoxNDg4OTIxMDM5LCJqdGkiOiI1NzhhYjMyMS00NmM4LTRjZTUtODA

GET /api/tool_bays

Response

[
  {
    "id": 2,
    "name": "Example Tool Bay",
    "device_id": 12
  }
]

GET /api/tool_bays/24

Response

{
  "id": 24,
  "name": "Example Tool Bay",
  "device_id": 92
}

PATCH /api/tool_bays/29

Request

{
  "name": "Fooo"
}

Response

{
  "id": 29,
  "name": "Fooo",
  "device_id": 125
}

POST /api/tool_slots

Response

[
  {
    "id": 6,
    "tool_bay_id": 8,
    "tool_id": null,
    "name": "first",
    "x": 1,
    "y": 2,
    "z": 3
  },
  {
    "id": 7,
    "tool_bay_id": 9,
    "tool_id": null,
    "name": "second",
    "x": 1,
    "y": 2,
    "z": 3
  },
  {
    "id": 8,
    "tool_bay_id": 10,
    "tool_id": null,
    "name": "third",
    "x": 1,
    "y": 2,
    "z": 3
  }
]

POST /api/tool_slots

Response

{
  "id": 25,
  "tool_bay_id": 28,
  "tool_id": null,
  "name": "Fooo",
  "x": 4,
  "y": 5,
  "z": 6
}

GET /api/tool_slots

Response

[
  {
    "id": 32,
    "tool_bay_id": 36,
    "tool_id": null,
    "name": null,
    "x": null,
    "y": null,
    "z": null
  }
]

PATCH /api/tool_slots/22

Response

{
  "id": 22,
  "tool_bay_id": 25,
  "tool_id": null,
  "name": "Fooo",
  "x": 1,
  "y": 2,
  "z": 3
}

GET /api/tool_slots/23

Response

{
  "id": 23,
  "tool_bay_id": 26,
  "tool_id": null,
  "name": "Example Tool Slot",
  "x": 1,
  "y": 2,
  "z": 3
}

DELETE /api/tool_slots/5

Response

Empty Response

POST /api/tools

Response

{
  "id": 2,
  "name": "wow2",
  "status": "inactive"
}

POST /api/tools

Response

{
  "id": 3,
  "name": "wow",
  "status": "inactive"
}

GET /api/tools

Response

[
  {
    "id": 19,
    "name": "GravelerExeggcute",
    "status": "unknown"
  }
]

PATCH /api/tools/26

Request

{
  "name": "Hi!"
}

Response

{
  "id": 26,
  "name": "Hi!",
  "status": "unknown"
}

DELETE /api/tools/27

Response

{
  "id": 27,
  "name": "DragonairAbra",
  "status": "unknown"
}

GET /api/tools/4

Response

{
  "id": 4,
  "name": "PoliwhirlJigglypuff",
  "status": "unknown"
}

PATCH /api/users

Request

{
  "new_password": "123456789",
  "new_password_confirmation": "123456789",
  "password": "Q0G1Lu4lN"
}

Response

{
  "id": 71,
  "email": "esta@stokesritchie.co",
  "verification_token": "374e06b5-274f-4ed3-a563-93e368f04140",
  "device_id": 107,
  "name": "Robbie Considine",
  "created_at": "2017-03-07T21:11:24.983Z",
  "updated_at": "2017-03-07T21:11:24.998Z",
  "verified_at": "2017-03-07T21:11:24.982Z",
  "agreed_to_terms_at": null
}

POST /api/users

Request

{
  "email": "lia@waters.biz",
  "name": "Frank",
  "password": "Password123",
  "password_confirmation": "Password123"
}

Response

{
  "message": "Check your email!"
}

DELETE /api/users

Request

{
  "password": "2xJ02xHxM"
}

Response

{
  "id": 76,
  "device_id": 112,
  "name": "Miss Christiana Breitenberg",
  "email": "robert@koepp.com",
  "created_at": "2017-03-07T21:11:25.948Z",
  "updated_at": "2017-03-07T21:11:25.948Z",
  "verified_at": "2017-03-07T21:11:25.947Z",
  "verification_token": "75bcb6ef-af62-4e32-9f1a-847827334e89",
  "agreed_to_terms_at": null
}

PATCH /api/users

Request

{
  "email": "rick@rick.com",
  "name": "Ricky McRickerson"
}

Response

{
  "id": 77,
  "email": "rick@rick.com",
  "name": "Ricky McRickerson",
  "verification_token": "9709b813-99f7-4888-8a49-be4aa7974ff6",
  "device_id": 113,
  "created_at": "2017-03-07T21:11:26.015Z",
  "updated_at": "2017-03-07T21:11:26.027Z",
  "verified_at": "2017-03-07T21:11:26.014Z",
  "agreed_to_terms_at": null
}

PUT /api/users/verify/163d0480-d4e5-4f31-b8bf-462

Request

{
  "token": "163d0480-d4e5-4f31-b8bf-46278dfbf0c5"
}

Response

{
  "token": {
    "unencoded": {
      "sub": "america_grant@harrismetz.biz",
      "iat": 1488921047,
      "jti": "d04a9583-8f65-4eaf-bc74-9bdbbb9073ca",
      "iss": "//localhost:3000",
      "exp": 1492377047,
      "mqtt": "blooper.io",
      "os_update_server": "http://blah.com",
      "fw_update_server": "http://test.com",
      "bot": "device_55"
    },
    "encoded": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhbWVyaWNhX2dyYW50QGhhcnJpc21ldHouYml6IiwiaWF0IjoxNDg4OTIxMDQ3LCJqdGkiOi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment