POST api/Bike/SaveImage
Saves an image file for this bike. The image will be assigned a new name, and uses name provided only for the extension (.jpg for example) Once saved, the image can be retrieved via the ImageURL property on bike
Request Information
URI Parameters
None.
Body Parameters
BikeImageUploadModelName | Description | Type | Additional information |
---|---|---|---|
BikeID | integer |
None. |
|
Content |
Provide binary content as base64string |
string |
None. |
Filename |
filename is used to determine extension only - image will receive a new filename |
string |
None. |
Request Formats
application/json, text/json
{ "BikeID": 1, "Content": "sample string 2", "Filename": "sample string 3" }
application/xml, text/xml
<BikeImageUploadModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Hub.Server.Models.DTO"> <BikeID>1</BikeID> <Content>sample string 2</Content> <Filename>sample string 3</Filename> </BikeImageUploadModel>
application/x-www-form-urlencoded
Sample not available.
Response Information
Resource Description
BikeModelName | Description | Type | Additional information |
---|---|---|---|
ID |
When adding a bike, ensure id = 0 |
integer |
None. |
TypeID | integer |
None. |
|
Type |
Readonly property returned when you fetch a bike |
string |
None. |
UserID |
Links bike to user |
integer |
None. |
CyclistDescription |
Readonly property returned when you fetch a bike |
string |
None. |
RefNo | string |
None. |
|
SerialNo | string |
None. |
|
Manufacturer | string |
None. |
|
Model | string |
None. |
|
Colour | string |
None. |
|
ModelYear | integer |
None. |
|
Km |
This is a calculated value - calculated from the sum of rides. To start off with a number of kms, insert one ride entry in the past with the required no of kms (note that rides are in meters) |
decimal number |
None. |
MovingTime |
This is a calculated value - calculated from the sum of rides. Minutes |
integer |
None. |
LastService | date |
None. |
|
DateBought | date |
None. |
|
StatusID |
Valid vales = 1, 2: lookup list of values with descriptions can be found on api/lookup |
integer |
None. |
Status |
Readonly property returned when you fetch a bike |
string |
None. |
MinutesToNextService |
Calculated based on service intervals of gear items, when they were added, and rides taken since, returns value of first item requiring service |
integer |
None. |
HoursToNextService | integer |
None. |
|
KmToNextService |
Calculated based on service intervals of gear items, when they were added, and rides taken since, returns value of first item requiring service |
integer |
None. |
KmSinceLastService |
Calculated field based on last service date and rides since |
integer |
None. |
MovingTimeSinceLastService |
Calculated field based on last service date and rides since in minutes |
integer |
None. |
ImageURL |
Field is populated by uploading an image for a bike. |
string |
None. |
ServicePercentage |
Calculated from the service percentages on gear |
integer |
None. |
Strava_Id | string |
None. |
|
IntegrationStatusID | integer |
None. |
|
OpeningKm | integer |
None. |
|
OpeningHours | integer |
None. |
|
UnitsOfMeasureID | integer |
None. |
|
HasKMBasedGear | boolean |
None. |
|
HasHourBasedGear | boolean |
None. |
|
BikeSize | string |
None. |
|
PartnerType | integer |
None. |
Response Formats
application/json, text/json
{ "ID": 1, "TypeID": 2, "Type": "sample string 3", "UserID": 4, "CyclistDescription": "sample string 5", "RefNo": "sample string 6", "SerialNo": "sample string 7", "Manufacturer": "sample string 8", "Model": "sample string 9", "Colour": "sample string 10", "ModelYear": 11, "Km": 12.1, "MovingTime": 13, "LastService": "2025-09-05T16:09:39.9602918+00:00", "DateBought": "2025-09-05T16:09:39.9602918+00:00", "StatusID": 14, "Status": "sample string 15", "MinutesToNextService": 16, "HoursToNextService": 17, "KmToNextService": 18, "KmSinceLastService": 19, "MovingTimeSinceLastService": 20, "ImageURL": "sample string 21", "ServicePercentage": 22, "Strava_Id": "sample string 23", "IntegrationStatusID": 24, "OpeningKm": 25, "OpeningHours": 26, "UnitsOfMeasureID": 27, "HasKMBasedGear": true, "HasHourBasedGear": true, "BikeSize": "sample string 30", "PartnerType": 31 }
application/xml, text/xml
<BikeModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Hub.Server.Models.DTO"> <BikeSize>sample string 30</BikeSize> <Colour>sample string 10</Colour> <CyclistDescription>sample string 5</CyclistDescription> <DateBought>2025-09-05T16:09:39.9602918+00:00</DateBought> <HasHourBasedGear>true</HasHourBasedGear> <HasKMBasedGear>true</HasKMBasedGear> <HoursToNextService>17</HoursToNextService> <ID>1</ID> <ImageURL>sample string 21</ImageURL> <IntegrationStatusID>24</IntegrationStatusID> <Km>12.1</Km> <KmSinceLastService>19</KmSinceLastService> <KmToNextService>18</KmToNextService> <LastService>2025-09-05T16:09:39.9602918+00:00</LastService> <Manufacturer>sample string 8</Manufacturer> <MinutesToNextService>16</MinutesToNextService> <Model>sample string 9</Model> <ModelYear>11</ModelYear> <MovingTime>13</MovingTime> <MovingTimeSinceLastService>20</MovingTimeSinceLastService> <OpeningHours>26</OpeningHours> <OpeningKm>25</OpeningKm> <PartnerType>31</PartnerType> <RefNo>sample string 6</RefNo> <SerialNo>sample string 7</SerialNo> <ServicePercentage>22</ServicePercentage> <Status>sample string 15</Status> <StatusID>14</StatusID> <Strava_Id>sample string 23</Strava_Id> <Type>sample string 3</Type> <TypeID>2</TypeID> <UnitsOfMeasureID>27</UnitsOfMeasureID> <UserID>4</UserID> </BikeModel>