Skip to content

Instantly share code, notes, and snippets.

@dragouf
Created August 8, 2017 08:26
Show Gist options
  • Save dragouf/127607b2e58ba1514a80e7c3288ef5cd to your computer and use it in GitHub Desktop.
Save dragouf/127607b2e58ba1514a80e7c3288ef5cd to your computer and use it in GitHub Desktop.
{"swagger":"2.0","info":{"version":"v1","title":"Vulog Carsharing FO API"},"basePath":"/api-fo/final","paths":{"/v1/availableVehicles":{"get":{"tags":["AvailableVehicles"],"summary":"All available vehicles.","description":"Get the list of all available vehicles, it can be a lot of data.","operationId":"V{versionAvailableVehiclesGet","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[],"responses":{"200":{"description":"An array of available vehicles","schema":{"type":"array","items":{"$ref":"#/definitions/AvailableVehicle"}}},"204":{"description":"No available vehicle found"}}}},"/v1/device/notification":{"post":{"tags":["Device"],"summary":"Susbcribe a phone device for push notifications","operationId":"V{versionDeviceNotificationPost","consumes":["application/json","text/json","application/json-patch+json"],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"subscription","in":"body","description":"the subscription details","required":false,"schema":{"$ref":"#/definitions/DeviceSubscription"}}],"responses":{"200":{"description":"Device successfully susbcribed for push notifications"},"400":{"description":"Failure during device subscription","schema":{"type":"array","items":{"$ref":"#/definitions/DeviceSubscriptionError"}}}}},"delete":{"tags":["Device"],"summary":"Unsusbcribe a phone device for push notifications","operationId":"V{versionDeviceNotificationDelete","consumes":["application/json","text/json","application/json-patch+json"],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"subscription","in":"body","required":false,"schema":{"$ref":"#/definitions/DeviceSubscription"}}],"responses":{"200":{"description":"Device successfully unsusbcribed for push notifications"},"400":{"description":"Failure during device unsubscription","schema":{"type":"array","items":{"$ref":"#/definitions/DeviceUnsubscriptionError"}}}}}},"/v1/journeys/{id}/booking":{"delete":{"tags":["Journey"],"summary":"Released a vehicle journey.","operationId":"V{versionJourneysByIdBookingDelete","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"id","in":"path","description":"Id of the journey to release.","required":true,"type":"string"}],"responses":{"200":{"description":"The journey is released."},"403":{"description":"End of journey refused","schema":{"$ref":"#/definitions/BookingError"}},"404":{"description":"Vehicle booking not found"},"405":{"description":"User is not allowed to end the vehicle booking"}}}},"/v1/journeys/{id}/trip":{"post":{"tags":["Journey"],"summary":"Start a vehicle trip.","description":"The user position is required, if successfull this method unlocks the vehicle doors","operationId":"V{versionJourneysByIdTripPost","consumes":["application/json","text/json","application/json-patch+json"],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"id","in":"path","description":"Id of the journey","required":true,"type":"string"},{"name":"user-lat","in":"header","description":"The user current latitude","required":false,"type":"string"},{"name":"user-lon","in":"header","description":"The user current longitude","required":false,"type":"string"},{"name":"details","in":"body","description":"The trip start details where trip options can be provided","required":false,"schema":{"$ref":"#/definitions/TripDetails"}}],"responses":{"200":{"description":"The trip is started.","schema":{"$ref":"#/definitions/Journey"}},"403":{"description":"User is not allowed to start the trip","schema":{"$ref":"#/definitions/BookingError"}}}},"delete":{"tags":["Journey"],"summary":"End a vehicle trip.","description":"End trip conditions need to be fullfilled","operationId":"V{versionJourneysByIdTripDelete","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"id","in":"path","description":"Id of the journey to release.","required":true,"type":"string"}],"responses":{"200":{"description":"The vehicle is released."},"403":{"description":"End trip refused (trip end conditions to met)","schema":{"$ref":"#/definitions/BookingError"}}}}},"/v1/mapping/homezones":{"get":{"tags":["Mapping"],"summary":"Gets the list of home zones.","operationId":"V{versionMappingHomezonesGet","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[],"responses":{"200":{"description":"The list of every home zones","schema":{"type":"array","items":{"$ref":"#/definitions/HomeZone"}}}}}},"/v1/mapping/homezones/{id}":{"get":{"tags":["Mapping"],"summary":"Gets a given home zone.","operationId":"V{versionMappingHomezonesByIdGet","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"id","in":"path","description":"The zone identifier.","required":true,"type":"string"}],"responses":{"200":{"description":"The requested zone","schema":{"type":"object"}},"404":{"description":"The requested zone does not exists"}}}},"/v1/mapping/layers/{id}":{"get":{"tags":["Mapping"],"summary":"Gets a specific layer.","operationId":"V{versionMappingLayersByIdGet","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"id","in":"path","description":"The layer identifier.","required":true,"type":"string"}],"responses":{"200":{"description":"The requested layer","schema":{"type":"object"}},"404":{"description":"The requested layer does not exists"}}}},"/v1/mapping/layers":{"get":{"tags":["Mapping"],"summary":"Gets all layers.","operationId":"V{versionMappingLayersGet","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[],"responses":{"200":{"description":"All the layers","schema":{"type":"array","items":{"$ref":"#/definitions/Layer"}}}}}},"/v1/user/currentJourney":{"get":{"tags":["User"],"summary":"The user current journey.","operationId":"V{versionUserCurrentJourneyGet","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"user-lat","in":"header","description":"The user current latitude","required":false,"type":"string"},{"name":"user-lon","in":"header","description":"The user current longitude","required":false,"type":"string"}],"responses":{"200":{"description":"A journey is associated to this user","schema":{"$ref":"#/definitions/Journey"}},"204":{"description":"No journey found for this user"}}}},"/v1/users":{"post":{"tags":["User"],"summary":"Create a new user","operationId":"V{versionUsersPost","consumes":["application/json","text/json","application/json-patch+json"],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"customer","in":"body","description":"The new user details (with login and password)","required":false,"schema":{"$ref":"#/definitions/UserRegistration"}}],"responses":{"200":{"description":"User and credentials created","schema":{"$ref":"#/definitions/UserRegistration"}},"400":{"description":"Bad requeset","schema":{"type":"string"}},"422":{"description":"List Customer validation error","schema":{"type":"array","items":{"$ref":"#/definitions/CreateCustomerApiError"}}},"424":{"description":"Credential Business Error","schema":{"$ref":"#/definitions/CredentialBusinessApiError"}},"500":{"description":"Unexpected server error"}}}},"/v1/user/profile":{"get":{"tags":["User"],"summary":"Get the user profile","operationId":"GetUserProfile","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[],"responses":{"200":{"description":"The user profile","schema":{"$ref":"#/definitions/UserProfile"}},"500":{"description":"Unexpected server error"}}}},"/v1/user":{"get":{"tags":["User"],"summary":"Get the user details","description":"Return all details for the current customer.","operationId":"V{versionUserGet","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[],"responses":{"200":{"description":"The user details","schema":{"$ref":"#/definitions/User"}},"500":{"description":"Server Error"}}},"put":{"tags":["User"],"summary":"Update a user","operationId":"Update","consumes":["application/json","text/json","application/json-patch+json"],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"customer","in":"body","description":"user to update","required":false,"schema":{"$ref":"#/definitions/User"}}],"responses":{"200":{"description":"Update user","schema":{"$ref":"#/definitions/UserResult"}},"422":{"description":"Parameter validation error","schema":{"$ref":"#/definitions/UpdateCustomerApiError"}}}}},"/v1/sendLostPasswordEmail":{"post":{"tags":["User"],"summary":"Send lost password email for the given login","description":"Send lost password email for the given login.","operationId":"SendLostPasswordEmail","consumes":["application/json","text/json","application/json-patch+json"],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"login","in":"body","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Email sent"},"500":{"description":"Server Error"},"422":{"description":"Validation error","schema":{"$ref":"#/definitions/CreateCustomerApiError"}},"424":{"description":"Business error","schema":{"$ref":"#/definitions/CredentialBusinessApiError"}}}}},"/v1/resetLostPassword":{"post":{"tags":["User"],"summary":"Reset customer password","description":"Reset customer password.","operationId":"ResetLostPassword","consumes":["application/json","text/json","application/json-patch+json"],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"credentialWithToken","in":"body","required":false,"schema":{"$ref":"#/definitions/CredentialWithToken"}}],"responses":{"200":{"description":"Password reset"},"500":{"description":"Server Error"},"424":{"description":"Business error","schema":{"$ref":"#/definitions/CredentialBusinessApiError"}}}}},"/v1/promocodes":{"post":{"tags":["User"],"summary":"Apply Promocode","operationId":"V{versionPromocodesPost","consumes":["application/json","text/json","application/json-patch+json"],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"promocode","in":"body","description":"","required":false,"schema":{"type":"string"}},{"name":"isRegistration","in":"query","description":"","required":false,"type":"boolean"}],"responses":{"200":{"description":"result OK","schema":{"type":"boolean"}},"424":{"description":"Promocode Business Error","schema":{"$ref":"#/definitions/PromoCodeBusinessApiError"}},"500":{"description":"Unexpected server error"}}}},"/v1/changePassword":{"post":{"tags":["User"],"summary":"Change customer password","description":"Change logged customer password.","operationId":"ChangePassword","consumes":["application/json","text/json","application/json-patch+json"],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"credential","in":"body","required":false,"schema":{"$ref":"#/definitions/Credential"}}],"responses":{"200":{"description":"Password changed"},"500":{"description":"Server Error"},"424":{"description":"Business error","schema":{"$ref":"#/definitions/CredentialBusinessApiError"}}}}},"/v1/vehicles/{id}":{"get":{"tags":["Vehicle"],"summary":"Vehicle details.","description":"Get the vehicle details.","operationId":"V{versionVehiclesByIdGet","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"id","in":"path","description":"Id of the desired vehicle.","required":true,"type":"string"}],"responses":{"200":{"description":"The vehicle details.","schema":{"$ref":"#/definitions/VehicleDetails"}},"401":{"description":"The vehicle exists but you are not allewed to retrieve its details."},"404":{"description":"The vehicle with the given id does not exists."}}}},"/v1/vehicles/{id}/journey":{"post":{"tags":["Vehicle"],"summary":"Book a vehicle.","description":"","operationId":"V{versionVehiclesByIdJourneyPost","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"id","in":"path","description":"Id of the desired vehicle.","required":true,"type":"string"}],"responses":{"200":{"description":"The vehicle is booked.","schema":{"$ref":"#/definitions/Journey"}},"403":{"description":"The user isn't allowed to start a journey with the vehicle","schema":{"$ref":"#/definitions/BookingBusinessApiError"}},"404":{"description":"The vehicle is not found"}}}},"/v1/vehicles/{vehicleId}/journeys/{journeyId}/reports":{"post":{"tags":["Vehicle"],"summary":"","operationId":"V{versionVehiclesByVehicleIdJourneysByJourneyIdReportsPost","consumes":["application/json","text/json","application/json-patch+json"],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"vehicleId","in":"path","description":"","required":true,"type":"string"},{"name":"journeyId","in":"path","description":"","required":true,"type":"string"},{"name":"report","in":"body","description":"The report for the current journey.","required":false,"schema":{"$ref":"#/definitions/ReportDetails"}}],"responses":{"200":{"description":"A list of upload item to get report upload urls","schema":{"type":"array","items":{"$ref":"#/definitions/UploadItem"}}}}}},"/{version}/models":{"get":{"tags":["Vehicle"],"summary":"Get the vehicle models","operationId":"ByVersionModelsGet","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[],"responses":{"200":{"description":"A list of model","schema":{"type":"array","items":{"$ref":"#/definitions/VehicleModel"}}}}}},"/{version}/options":{"get":{"tags":["Vehicle"],"summary":"Get the vehicle models","operationId":"ByVersionOptionsGet","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[],"responses":{"200":{"description":"A list of model","schema":{"type":"array","items":{"$ref":"#/definitions/VehicleOption"}}}}}}},"definitions":{"AvailableVehicle":{"type":"object","properties":{"status":{"$ref":"#/definitions/VehicleStatus"},"vehicleDescription":{"$ref":"#/definitions/VehicleDetails"},"location":{"$ref":"#/definitions/Location"},"iconsUrl":{"type":"string"},"tokenIconsUrl":{"type":"string"}}},"VehicleStatus":{"type":"object","properties":{"energyLevel":{"format":"int32","type":"integer"}}},"VehicleDetails":{"type":"object","properties":{"id":{"type":"string"},"model":{"type":"string"},"plate":{"type":"string"},"name":{"type":"string"},"modelId":{"format":"int32","type":"integer"},"optionIds":{"type":"array","items":{"format":"int32","type":"integer"}}}},"Location":{"type":"object","properties":{"address":{"$ref":"#/definitions/Address"},"position":{"$ref":"#/definitions/Position"}}},"Address":{"type":"object","properties":{"streetAddress":{"type":"string"},"locality":{"type":"string"},"postalCode":{"type":"string"},"region":{"type":"string"},"country":{"type":"string"}}},"Position":{"type":"object","properties":{"lat":{"format":"double","type":"number"},"lon":{"format":"double","type":"number"}}},"DeviceSubscription":{"required":["deviceToken","applicationName"],"type":"object","properties":{"deviceToken":{"type":"string"},"applicationName":{"type":"string"}}},"DeviceSubscriptionError":{"type":"object","properties":{"code":{"enum":["invalidApplication","unknowUserLocale"],"type":"string"},"message":{"type":"string"}}},"DeviceUnsubscriptionError":{"type":"object","properties":{"code":{"enum":["invalidApplication"],"type":"string"},"message":{"type":"string"}}},"BookingError":{"type":"object","properties":{"errors":{"type":"array","items":{"enum":["bookingEndRefused","cardMissing","customerServiceIdNotFound","doorsOrWindowsNotClosed","invalidTripUseState","keyMissing","missingParameter","notAuthorized","tripEndRefused","tripStartRefused","unknownError","vehicleAllreadyBookedToCustomer","vehicleNotFreeOrBadRFID","vehicleNotInZone","nullInputParams","paymentServiceProviderInvalid","paymentTypeInvalid","paymentReferenceNotFound","customerServiceInvalidNewWorkflowStatus","sleepingVehicle","notReachableVehicle","noBookingToCancel","proximityControlNotInRange","customerServiceInvalidGender","customerHasNoRfid","identityLoginAlreadyExist","identityLoginOrPasswordMissing","identityFamily_NameMissing","identityGiven_NameMissing","invalidEmail","identityCustomerCreationFailed","identityCustomerCredentialsFailed","identityCustomerInvalidLogin","identityCustomerInvalidBirthDate","identityCustomerInvalidLanguage","identityCustomerInvalidDrivingLicenceCountry","aPICreateUserTermsAndConditions","aPICreateUserSecurityValidationFailure"],"type":"string"}}}},"TripDetails":{"type":"object","properties":{"options":{"type":"array","items":{"type":"string"}}}},"Journey":{"type":"object","properties":{"id":{"type":"string"},"energyLevel":{"format":"int32","type":"integer"},"vehicleId":{"type":"string"},"position":{"$ref":"#/definitions/Position"},"booking":{"$ref":"#/definitions/Booking"},"trip":{"$ref":"#/definitions/Trip"},"rel":{"type":"array","items":{"enum":["bookingCreate","bookingDelete","tripCreate","tripDelete"],"type":"string"}}}},"Booking":{"type":"object","properties":{"bookingDate":{"format":"date-time","type":"string"},"maxTripStartDate":{"format":"date-time","type":"string"},"serverDate":{"format":"date-time","type":"string","readOnly":true},"isVehicleInRange":{"type":"boolean"}}},"Trip":{"type":"object","properties":{"inZone":{"type":"boolean"}}},"HomeZone":{"type":"object","properties":{"id":{"type":"string"},"zone":{"type":"object"}}},"Layer":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"object"}}},"UserRegistration":{"required":["email"],"type":"object","properties":{"login":{"type":"string"},"password":{"type":"string"},"phoneNumber":{"type":"string"},"email":{"type":"string"},"locale":{"type":"string"},"address":{"$ref":"#/definitions/Address"},"extendedInfo":{"type":"array","items":{"$ref":"#/definitions/UserExtension"}},"firstName":{"type":"string"},"lastName":{"type":"string"},"middleName":{"type":"string"},"preferredUsername":{"type":"string"},"gender":{"type":"string"},"birthDate":{"format":"date-time","type":"string"},"identificationType":{"format":"byte","type":"string"},"accountType":{"format":"int32","type":"integer"},"drivingLicence":{"$ref":"#/definitions/DrivingLicence"},"emailConsent":{"type":"boolean"},"identificationNumber":{"type":"string"},"address2":{"type":"string"},"billingAddress":{"$ref":"#/definitions/Address"},"termsAndConditions":{"format":"date-time","type":"string"}}},"UserExtension":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}},"DrivingLicence":{"type":"object","properties":{"number":{"type":"string"},"countryCode":{"type":"string"},"province":{"type":"string"},"expirationDate":{"format":"date-time","type":"string"}}},"CreateCustomerApiError":{"type":"object","properties":{"code":{"enum":["emailRequired","emailInvalid","termsAndConditionsRequired","phoneNumberInvalid","phoneNumber2Invalid","genderInvalid","birthDateInvalid","drivingLicenceCountryInvalid","userLocaleInvalid"],"type":"string"},"message":{"type":"string"}}},"CredentialBusinessApiError":{"type":"object","properties":{"code":{"enum":["badCustomerId","tokenAlreadyRevoked","customerNotFound","tokenError","loginRequired","passwordRequired","credentialsErrorCustomerNotRollBacked","credentialsErrorCustomerRollBacked","loginInvalid"],"type":"string"},"message":{"type":"string"}}},"UserProfile":{"type":"object","properties":{"role":{"type":"string"},"status":{"type":"string"}}},"User":{"required":["email"],"type":"object","properties":{"phoneNumber":{"type":"string"},"email":{"type":"string"},"locale":{"type":"string"},"address":{"$ref":"#/definitions/Address"},"extendedInfo":{"type":"array","items":{"$ref":"#/definitions/UserExtension"}},"firstName":{"type":"string"},"lastName":{"type":"string"},"middleName":{"type":"string"},"preferredUsername":{"type":"string"},"gender":{"type":"string"},"birthDate":{"format":"date-time","type":"string"},"identificationType":{"format":"byte","type":"string"},"accountType":{"format":"int32","type":"integer"},"drivingLicence":{"$ref":"#/definitions/DrivingLicence"},"emailConsent":{"type":"boolean"},"identificationNumber":{"type":"string"},"address2":{"type":"string"},"billingAddress":{"$ref":"#/definitions/Address"},"termsAndConditions":{"format":"date-time","type":"string"}}},"UserResult":{"required":["email"],"type":"object","properties":{"id":{"type":"string"},"phoneNumber":{"type":"string"},"email":{"type":"string"},"locale":{"type":"string"},"address":{"$ref":"#/definitions/Address"},"extendedInfo":{"type":"array","items":{"$ref":"#/definitions/UserExtension"}},"firstName":{"type":"string"},"lastName":{"type":"string"},"middleName":{"type":"string"},"preferredUsername":{"type":"string"},"gender":{"type":"string"},"birthDate":{"format":"date-time","type":"string"},"identificationType":{"format":"byte","type":"string"},"accountType":{"format":"int32","type":"integer"},"drivingLicence":{"$ref":"#/definitions/DrivingLicence"},"emailConsent":{"type":"boolean"},"identificationNumber":{"type":"string"},"address2":{"type":"string"},"billingAddress":{"$ref":"#/definitions/Address"},"termsAndConditions":{"format":"date-time","type":"string"}}},"UpdateCustomerApiError":{"type":"object","properties":{"code":{"enum":["emailRequired","emailInvalid","termsAndConditionsRequired","phoneNumberInvalid","phoneNumber2Invalid","genderInvalid","birthDateInvalid","drivingLicenceCountryInvalid","userLocaleInvalid"],"type":"string"},"message":{"type":"string"}}},"CredentialWithToken":{"required":["token"],"type":"object","properties":{"token":{"format":"uuid","type":"string"},"login":{"type":"string"},"password":{"type":"string"}}},"PromoCodeBusinessApiError":{"type":"object","properties":{"code":{"enum":["promoCodeInvalid","promocodeEmpty"],"type":"string"},"message":{"type":"string"}}},"Credential":{"type":"object","properties":{"login":{"type":"string"},"password":{"type":"string"}}},"BookingBusinessApiError":{"type":"object","properties":{"code":{"enum":["missingParameter","notAuthorized","unknownError","customerServiceIdNotFound","invalidTripUseState","cardMissing","keyMissing","doorsOrWindowsNotClosed","vehicleNotInZone","vehicleNotFreeOrBadRFID","sleepingVehicle","notReachableVehicle","vehicleAlreadyBookForThisCustomer","proximityControlNotInRange","customerHasNoRfid","fleetServiceBookFailed"],"type":"string"},"message":{"type":"string"}}},"ReportDetails":{"type":"object","properties":{"categories":{"type":"array","items":{"format":"int64","type":"integer"}}}},"UploadItem":{"type":"object","properties":{"id":{"format":"int64","type":"integer"},"url":{"type":"string"},"token":{"type":"string"}}},"VehicleModel":{"type":"object","properties":{"energyType":{"enum":["unknown","hybrid","fuel","electric"],"type":"string"},"autonomyUnit":{"enum":["km","mi","unknown"],"type":"string"},"name":{"type":"string"},"id":{"format":"int32","type":"integer"},"manufacturer":{"type":"string"},"seats":{"format":"int32","type":"integer"},"autonomy":{"format":"int32","type":"integer"}}},"VehicleOption":{"type":"object","properties":{"id":{"format":"int32","type":"integer"},"name":{"type":"string"},"description":{"type":"string"}}}},"securityDefinitions":{"OpenID Connect":{"flow":"password","authorizationUrl":"http://api.feat2-dev.beta/identity/core/connect/authorize","tokenUrl":"http://api.feat2-dev.beta/identity/core/connect/token","scopes":{"CarSharing":"CarSharing offline_access openid"},"type":"oauth2"}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment