FluidCloud API Documentation
Welcome to the FluidCloud API Documentation. The FluidCloud API allows you to connect and exchange data with FluidCloud website. FluidCloud Api require access token to get data.
Login into FluidCloud system. Navigate to API page with url: https://fluidcloud.co/my-account/api Click "Generate" to create new Token. Copy the token to your clipboard.
With each API call, you must set request headers including an FluidCloud access token.
curl -X "GET" "https://fluidcloud.co/rest/v1.0/tank"\ -H "access-token: k_3jNaipiIid9K934UplmEbP5q7LfPFdq_ne21GJ7Zw"
Tank's collection and information
Get collection of tanks
FluidCloud uses access token security scheme. With each API call, you must set request headers including an FluidCloud access token.
Type: application/json
Example:
{ "data": [ { "id": 2109, "title": "Newberg Test Tank", "resource_uri": "https://fluidcloud.co/rest/v1.0/tank/2109", "location": { "id": 1938, "title": "Location 1", "resource_uri": "https://fluidcloud.co/rest/v1.0/location/1938", "address": "123 NE Main St.", "state": "", "country": "US", "latitude": "10.1234567", "longitude": "100.1234567", "zip": null }, "tank_shape": "cylinder-v", "tank_capacity": "3008.09", "current_inventory": "1700", "low_level": "9", "critical_low_level": "8", "tank_product": "403", "inventory_level": "normal", "price_per_unit": "2.01", "variance_tolerance": "2", "fuel_temp": null, "payment_account_number": "999", "latitude": "10.1234567", "longitude": "100.1234567", "status": "1" }, { "id": 2110, "title": "Newberg Test Tank", "resource_uri": "https://fluidcloud.co/rest/v1.0/tank/2110", "location": { "id": 1938, "title": "Location 2", "resource_uri": "https://fluidcloud.co/rest/v1.0/location/1938", "address": "123 NE Main St.", "state": "", "country": "US", "latitude": "10.7949390", "longitude": "106.6779670", "zip": null }, "tank_shape": "cylinder-h", "tank_capacity": "4283.01", "current_inventory": "2300", "low_level": "9", "critical_low_level": "5", "tank_product": "401", "inventory_level": "normal", "price_per_unit": "2.03", "variance_tolerance": "2", "fuel_temp": null, "payment_account_number": null, "latitude": null, "longitude": null, "status": "1" } ], "meta": { "total": 3, "previous": null, "per_page": 2, "next": "https://fluidcloud.co/rest/v1.0/tank?page[number]=2" } }
A valid access token.
Bad or expired token.
Bad request.
{ "data": [ { "id": 2109, "title": "Newberg Test Tank", "resource_uri": "https://fluidcloud.co/rest/v1.0/tank/2109", "location": { "id": 1938, "title": "Location 1", "resource_uri": "https://fluidcloud.co/rest/v1.0/location/1938", "address": 123 NE Main St.", "state": "", "country": "US", "latitude": "10.1234567", "longitude": "100.1234567", "zip": null }, "tank_shape": "cylinder-v", "tank_capacity": "3008.09", "current_inventory": "1700", "low_level": "9", "critical_low_level": "8", "tank_product": "403", "inventory_level": "normal", "price_per_unit": "2.01", "variance_tolerance": "2", "fuel_temp": null, "payment_account_number": "999", "latitude": "10.1234567", "longitude": "100.1234567", "status": "1" } ], "meta": { "previous": null, "per_page": 50, "next": null } }
Set Tank GPS lat and long
Schema:
{ "$schema": "http://json-schema.org/draft-03/schema", "title": "JSON Schema for an GPS", "required": true, "properties": { "latitude": { "type": "string", "description": "latitude data.", "required": true }, "longitude": { "type": "string", "description": "longitude data.", "required": true } } }
{ "latitude": "10.1234567", "longitude": "100.1234567" }
Update inventory
{ "$schema": "http://json-schema.org/draft-03/schema", "title": "JSON Schema for GPS data", "required": true, "properties": { "latitude": { "type": "string", "description": "latitude data.", "required": true }, "longitude": { "type": "string", "description": "longitude data.", "required": true } } }
{"current_inventory": 1234}
Location's collection and information
{ "data": [ { "id": 1938, "title": "Location 1", "resource_uri": "https://fluidcloud.co/rest/v1.0/location/1938", "address": 123 NE Main St.", "state": "", "country": "US", "latitude": "10.1234567", "longitude": "100.1234567", "zip": null }, { "id": 1938, "title": "Location 2", "resource_uri": "https://fluidcloud.co/rest/v1.0/location/1938", "address": "555 SE Center St.", "state": "", "country": "US", "latitude": "10.7949390", "longitude": "106.6779670", "zip": null }, { "id": 1939, "title": "Location 3", "resource_uri": "https://fluidcloud.co/rest/v1.0/location/1938", "address": "567 NW Burnside St.", "state": "", "country": "US", "latitude": "10.7949390", "longitude": "106.6779670", "zip": null } ], "meta": { "total": 0, "previous": null, "per_page": 50, "next": null } }
Update location name and zipcode
{ "title": "My Location", "zip": "97202" }
{ "data": [ { "id": 1938, "title": "My Location", "resource_uri": "https://fluidcloud.co/rest/v1.0/location/1938", "address": 123 NE Main St.", "state": "", "country": "US", "latitude": "10.3489430", "longitude": "104.62343670", "zip": "97202" } ], "meta": { "total": 0, "previous": null, "per_page": 50, "next": null } }
Vehicle's collection and information
Get collection of vehicle
{ "data": [ { "id": 1941, "resource_uri": "https://fuelcloud.dev/rest/v1.0/vehicle/1941", "name": "Vehicle 1", "status": "1", "taxable": "fed_state", "tank_capacity": "100.00", "product": [ { "id": 400, "name": "BIO DIESEL B2" }, { "id": 401, "name": "BIO-DIESEL B5" } ] }, { "id": 1950, "resource_uri": "https://fuelcloud.dev/rest/v1.0/vehicle/1950", "name": "Vehicle", "status": "1", "taxable": "state", "tank_capacity": "100.00", "product": [ { "id": 400, "name": "BIO DIESEL B2" }, { "id": 401, "name": "BIO-DIESEL B5" } ] }, { "id": 1953, "resource_uri": "https://fuelcloud.dev/rest/v1.0/vehicle/1953", "name": "Vehicle 2", "status": "1", "taxable": "none", "tank_capacity": null, "product": [ { "id": 400, "name": "BIO DIESEL B2" }, { "id": 401, "name": "BIO-DIESEL B5" } ] }, { "id": 1954, "resource_uri": "https://fuelcloud.dev/rest/v1.0/vehicle/1954", "name": "Vehicle 3", "status": "1", "taxable": "fed", "tank_capacity": "0.00", "product": [ { "id": 400, "name": "BIO DIESEL B2" }, { "id": 401, "name": "BIO-DIESEL B5" } ] }, { "id": 2223, "resource_uri": "https://fuelcloud.dev/rest/v1.0/vehicle/2223", "name": "DEMO", "status": "1", "taxable": "none", "tank_capacity": "0.00", "product": [ { "id": 400, "name": "BIO DIESEL B2" }, { "id": 403, "name": "BIO-DIESEL B11" }, { "id": 401, "name": "BIO-DIESEL B5" }, { "id": 402, "name": "BIO-DIESEL B100" }, { "id": 1937, "name": "Forix LLC" }, { "id": 2226, "name": "DEMO 4" } ] } ], "meta": { "total": 0, "previous": null, "per_page": 50, "next": null } }
Update vehicle custom data tags.
{ "pan_1": { "first": "Name 1", "second": "Value 1" }, "pan_2": { "first": "Name 2", "second": "Value 2" }, "pan_3": { "first": "Name 3", "second": "Value 3" } }
{ "data": [ { "id": 1941, "resource_uri": "http://fuelcloud.dev/rest/v1.0/vehicle/1941", "name": "Vehicle 1", "status": "1", "taxable": "fed_state", "tank_capacity": "100.00", "product": [ { "id": 400, "name": "BIO DIESEL B2" }, { "id": 401, "name": "BIO-DIESEL B5" } ], "pan_1": { "first": "Name 1", "second": "Value 1" }, "pan_2": { "first": "Name 2", "second": "Value 2" }, "pan_3": { "first": "Name 3", "second": "Value 3" } } ], "meta": { "total": 1, "previous": null, "per_page": 50, "next": null } }
Driver's collection and information
Get collection of driver
{ "data": [ { "id": 3437, "fullname": "QA MOD", "pin": "61904", "phone": "", "schedule": false, "all_tanks": null, "tanks": [], "all_vehicles": false, "vehicles": null, "self": "https://fluidcloud.co/rest/v1.0/driver/3437" }, { "id": 3438, "fullname": "Driver 1", "pin": "72794", "phone": null, "schedule": { "all": "1", "day_0": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_1": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_2": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_3": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_4": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_5": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_6": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 } }, "all_tanks": null, "tanks": [ 2180 ], "all_vehicles": true, "vehicles": [ 1941, 1950, 1953, 1954, 2223 ], "self": "https://fluidcloud.co/rest/v1.0/driver/3438" }, { "id": 3493, "fullname": "DEV Test", "pin": "03910", "phone": "111111111111", "schedule": false, "all_tanks": null, "tanks": [], "all_vehicles": false, "vehicles": null, "self": "https://fluidcloud.co/rest/v1.0/driver/3493" }, { "id": 3518, "fullname": "QA MOB 2", "pin": "80314", "phone": null, "schedule": false, "all_tanks": null, "tanks": [], "all_vehicles": false, "vehicles": null, "self": "https://fluidcloud.co/rest/v1.0/driver/3518" }, { "id": 3523, "fullname": "DEV MOB", "pin": "32712", "phone": null, "schedule": false, "all_tanks": null, "tanks": [], "all_vehicles": false, "vehicles": null, "self": "https://fluidcloud.co/rest/v1.0/driver/3523" }, { "id": 3526, "fullname": "FluidCloud QA", "pin": "66059", "phone": "", "schedule": false, "all_tanks": null, "tanks": [], "all_vehicles": false, "vehicles": null, "self": "https://fluidcloud.co/rest/v1.0/driver/3526" }, { "id": 3598, "fullname": "Driver 2", "pin": "83737", "phone": "5037644123", "schedule": { "all": "1", "day_0": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_1": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_2": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_3": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_4": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_5": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_6": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 } }, "all_tanks": true, "tanks": [ 2109, 2110, 2112, 2116, 2123, 2125, 2127, 2134, 2138, 2150, 2152, 2162, 2167, 2176, 2178, 2180, 2182 ], "all_vehicles": true, "vehicles": [ 1941, 1950, 1953, 1954, 2223 ], "self": "https://fluidcloud.co/rest/v1.0/driver/3598" }, { "id": 3606, "fullname": "Driver Name", "pin": "66682", "phone": "", "schedule": { "day_0": { "status": "1", "start_hour": "5", "start_min": "00", "start_meridiem": "am", "end_hour": "1", "end_min": "00", "end_meridiem": "pm" }, "day_1": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_2": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_3": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_4": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_5": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_6": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "all": 0 }, "all_tanks": false, "tanks": [ 2109, 2110, 2112, 2116, 2123, 2125, 2127, 2134, 2138, 2150, 2152, 2162, 2167, 2176, 2178, 2180, 2182 ], "all_vehicles": true, "vehicles": [ 1941, 1950, 1953, 1954, 2223 ], "self": "https://fluidcloud.co/rest/v1.0/driver/3606" }, { "id": 3607, "fullname": "Driver Name", "pin": "11182", "phone": null, "schedule": false, "all_tanks": false, "tanks": [ 2109, 2110, 2112, 2116, 2123, 2125, 2127, 2134, 2138, 2150, 2152, 2162, 2167, 2176, 2178, 2180, 2182 ], "all_vehicles": true, "vehicles": [ 1941, 1950, 1953, 1954, 2223 ], "self": "https://fluidcloud.co/rest/v1.0/driver/3607" }, { "id": 3608, "fullname": "Driver Name", "pin": "11183", "phone": null, "schedule": false, "all_tanks": false, "tanks": [ 2109, 2110, 2112, 2116, 2123, 2125, 2127, 2134, 2138, 2150, 2152, 2162, 2167, 2176, 2178, 2180, 2182 ], "all_vehicles": true, "vehicles": [ 1941, 1950, 1953, 1954, 2223 ], "self": "https://fluidcloud.co/rest/v1.0/driver/3608" }, { "id": 3609, "fullname": "Driver Name", "pin": "11184", "phone": null, "schedule": false, "all_tanks": false, "tanks": [ 2109, 2110, 2112, 2116, 2123, 2125, 2127, 2134, 2138, 2150, 2152, 2162, 2167, 2176, 2178, 2180, 2182 ], "all_vehicles": true, "vehicles": [ 1941, 1950, 1953, 1954, 2223 ], "self": "https://fluidcloud.co/rest/v1.0/driver/3609" }, { "id": 3610, "fullname": "Driver Name", "pin": "11185", "phone": null, "schedule": false, "all_tanks": false, "tanks": [ 2109, 2110, 2112, 2116, 2123, 2125, 2127, 2134, 2138, 2150, 2152, 2162, 2167, 2176, 2178, 2180, 2182 ], "all_vehicles": true, "vehicles": [ 1941, 1950, 1953, 1954, 2223 ], "self": "https://fluidcloud.co/rest/v1.0/driver/3610" }, { "id": 3611, "fullname": "Driver Name", "pin": "11187", "phone": null, "schedule": { "all": 1 }, "all_tanks": false, "tanks": [ 2109, 2110, 2112, 2116, 2123, 2125, 2127, 2134, 2138, 2150, 2152, 2162, 2167, 2176, 2178, 2180, 2182 ], "all_vehicles": true, "vehicles": [ 1941, 1950, 1953, 1954, 2223 ], "self": "https://fluidcloud.co/rest/v1.0/driver/3611" } ], "meta": { "total": 0, "previous": null, "per_page": 50, "next": null } }
Create driver
Update custom data tags.
{ "fullname": "Driver Name", "pin": "11187", "phone": "", "all_tanks": false, "tanks": [ 2109 ], "all_vehicles": true, "vehicles": [ 1941, 1950 ], "schedule": { "all": 1 } }
{ "data": [ { "id": 3438, "fullname": "Driver 1", "pin": "11187", "phone": null, "schedule": { "all": "1", "day_0": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_1": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_2": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_3": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_4": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_5": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 }, "day_6": { "start_hour": "", "start_min": "", "start_meridiem": "am", "end_hour": "", "end_min": "", "end_meridiem": "am", "status": 0 } }, "all_tanks": null, "tanks": [ 2109 ], "all_vehicles": true, "vehicles": [ 1941, 1950 ], "self": "http://fluidcloud.co/rest/v1.0/driver/3438" } ], "meta": { "total": 0, "previous": null, "per_page": 50, "next": null } }
Transaction's collection and information
Get all transaction of all tanks.
Get transaction of driver using query string with format filter[driver_id] = {id}. Example get transaction of tank id 2000, call the url https://fluidcloud.co/rest/v1.0/transaction?filter[driver_id]=2000
Get transaction of tank using query string with format filter[tank_id] = {id}. Example get transaction of tank id 1500, call the url https://fluidcloud.co/rest/v1.0/transaction?filter[tank_id]=1500
Get transaction of vehicle using query string with format filter[vehicle_id] = {id}. Example get transaction of vehicle id 1000, call the url https://fluidcloud.co/rest/v1.0/transaction?filter[vehicle_id]=1000
Create PUMP transaction
Create FILL transaction
{ "data": [ { "id": 3738, "label": "", "self": "https://fluidcloud.co/rest/v1.0/transaction/3738", "transaction_id": "1937-3437-1471420077", "transaction_type": 1, "tank_id": "1940", "start_date": "2017-03-30T00:00:00Z", "end_date": "2017-04-01T07:00:00Z", "location_id": "1938", "product_id": "400", "inventory": "2950.00000", "volume": "50.00000", "percent": "54.1", "price": "2", "starting_inches": null, "ending_inches": null, "driver_id": "3438", "vehicle_id": "1941", "pin": "72794", "driver_type": "", "taxed": "fed_state", "created": "1471420020", "payment_account_number": null }, { "id": 3739, "label": "", "self": "https://fluidcloud.co/rest/v1.0/transaction/3739", "transaction_id": "1937-3437-1471420268", "transaction_type": 1, "tank_id": "1940", "start_date": "2017-03-30T00:00:00Z", "end_date": "2017-04-01T07:00:00Z", "location_id": "1938", "product_id": "400", "inventory": "2940.00000", "volume": "10.00000", "percent": "53.91", "price": "2", "starting_inches": null, "ending_inches": null, "driver_id": "3438", "vehicle_id": "1941", "pin": "72794", "driver_type": "", "taxed": "fed_state", "created": "1471420200", "payment_account_number": null } ], "meta": { "total": 2, "previous": null, "per_page": 50, "next": null } }
{ "$schema": "http://json-schema.org/draft-03/schema", "title": "JSON Schema for a pump transaction", "required": false, "properties": { "transaction_type": { "type": "integer", "description": "The transaction type, 1 for PUMP, 2 for FILL.", "required": true }, "transaction_id": { "type": "string", "description": "The uuid of transaction.", "required": true }, "volume": { "type": "number", "description": "The pupm volume in gallon.", "required": true }, "tank_id": { "type": "integer", "description": "The tank id for fill action", "required": true }, "driver_id": { "type": "integer", "description": "The jobber id for fill action", "required": true }, "created": { "type": "number", "description": "Timespan value when create fill action.", "required": true }, "price": { "type": "number", "description": "Price per gallon.", "required": false }, } }
{ "transaction_type": 1, "transaction_id": "00cb261e-a01c-c0e0-c914-f71f2b87b18w", "volume": 100, "tank_id": 2109, "vehicle_id": 1941, "driver_id": 3438, "price": 22 }
{ "data": [ { "id": 3738, "label": "", "self": "https://fluidcloud.co/rest/v1.0/transaction/3738", "transaction_id": "1937-3437-1471420077", "transaction_type": 1, "tank_id": "1940", "start_date": "2017-03-30T00:00:00Z", "end_date": "2017-04-01T07:00:00Z", "location_id": "1938", "product_id": "400", "inventory": "2950.00000", "volume": "50.00000", "percent": "54.1", "price": "2", "starting_inches": null, "ending_inches": null, "driver_id": "3438", "vehicle_id": "1941", "pin": "72794", "driver_type": "", "taxed": "fed_state", "created": "1471420020", "payment_account_number": null } ], "meta": { "previous": null, "per_page": 50, "next": null } }
{ "$schema": "http://json-schema.org/draft-03/schema", "title": "JSON Schema for a fill transaction", "required": false, "properties": { "transaction_type": { "type": "integer", "description": "The transaction type, 1 for PUMP, 2 for FILL.", "required": true }, "transaction_id": { "type": "string", "description": "The uuid of transaction.", "required": true }, "volume": { "type": "number", "description": "The fill volume in gallon.", "required": true }, "tank_id": { "type": "integer", "description": "The tank id for fill action", "required": true }, "driver_id": { "type": "integer", "description": "The jobber id for fill action", "required": true }, "starting_inches": { "type": "number", "description": "Starting inches of fill.", "required": true }, "ending_inches": { "type": "number", "description": "Ending inches of fill.", "required": true }, "price": { "type": "number", "description": "Price per gallon.", "required": true }, "created": { "type": "number", "description": "Timespan value when create fill action.", "required": true } } }
{ "transaction_type": 2, "transaction_id": "00cb261e-a01c-c0e0-c914-f71f2b87b18d", "volume": "100", "tank_id": 2110, "starting_inches": 10, "ending_inches": 50.5, "price": 2.2, "created": 1480662618, "driver_id": 3437 }
Get addition fields for current company
{ "data": [ { "additional": [ { "id": 103, "label": "Odometer", "required": 1, "value": "", "field_type": "number" }, { "id": 104, "label": "Job Number", "required": 1, "value": "", "field_type": "string" }, { "id": 107, "label": "custom 1", "required": 0, "value": "", "field_type": "string" }, { "id": 108, "label": "custom 2", "required": 0, "value": "", "field_type": "string" }, { "id": 109, "label": "aaa", "required": 0, "value": "", "field_type": "string" } ] } ], "meta": { "total": 0, "previous": null, "per_page": 50, "next": null } }