Emmy is a german rental service for electric motorbikes 🛵 (also called scooter, the wording is a mess). Currently, Emmy offers its service in Berlin, Hamburg and Munich.
API is based on exchanging json messages.
Base url: https://api.emmy.ninja
Below you find most API calls that the official emmy android app uses. However, some of them are not really tested. Additionally, there are even more API calls mostly related to the verification process (Upload video etc).
curl --location --request POST 'https://api.emmy.ninja/auth/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"password": "pass",
"username": "email"
}'
You'll receive a bunch of information related to your user. For authentication
the accessToken
is needed. With that, you can create the authorization header
as following: Authorization: Bearer $ACCESS_TOKEN
. Sometimes you need the
signupToken
instead of the accessToken. When ever this is needed the
authorization is written that way: Authorization: Bearer $SIGNUP_TOKEN
There is also an option to log out (invalidate the accessToken?) tbc
curl --location --request POST 'https://api.emmy.ninja/reset-password' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "mail@example.org"
}'
curl --location --request POST 'https://api.emmy.ninja/users/$USER_ID/password' \
--header 'Authorization: Bearer $SIGNUP_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "mail@example.org",
"oldPassword": "foo",
"newPassword": "bar"
}'
Some requests work without suppling authorization as they are public information.
Lists all vehicles that are available for renting.
curl --location --request GET 'https://api.emmy.ninja/vehicles'
Show information for a specific vehicle by $VEHICLE_ID
. Get the ID by
calling the general vehicles
endpoint. Note: The ID seems to be
auto-increment. You'll find more vehicles by simply incrementing the ID - even
those that are currently not available for rental.
curl --location --request GET 'https://api.emmy.ninja/vehicles/$VEHICLE_ID'
curl --location --request GET 'https://api.emmy.ninja/vehicles/types'
When you notice a damage on a vehicle before you go on a ride, you can send a damage report. Note, that you need a rentalId for it that you obtain when creating a rental on a vehicle.
curl --location --request POST 'https://api.emmy.ninja/vehicles/$VEHICLE_ID/damages' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--data-raw '{
"description": "A human readable description of the damage",
"damages": [
{
"position": "foo",
"type": "bar"
}
],
"rentalId": $RENTAL_ID
}'
In order to create a rental, you need a $VEHICLE_ID
.
curl --location --request POST 'https://api.emmy.ninja/vehicles/$VEHICLE_ID/rentals' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{}'
This starts a reservation and you have 15 min time to actually start the rental.
In the response you receive a rentalId that you have to store as $RENTAL_ID
for later usage.
pricingDuringRide
.
curl --location --request POST 'https://api.emmy.ninja/vehicles/$VEHICLE_ID/rentals/$RENTAL_ID/start' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"isCarClean": false,
"isCarDamaged": false,
"isDriversLicenceWithUser": false
}'
Note: you can set all values to true
or false
. The API doesn't care and will
start the rental either way.
curl --location --request POST 'https://api.emmy.ninja/vehicles/$VEHICLE_ID/rentals/$RENTAL_ID/stop' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{}'
You can also pause the rental if you want to park your vehicle and but want to
use it later. This will reduce the price per minute as specified in
pricingDuringPark
in the vehicle information
curl --location --request POST 'https://api.emmy.ninja/vehicles/$VEHICLE_ID/rentals/$RENTAL_ID/park' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{}'
The API exposes some information on the user.
languageId
is known
so far.
curl --location --request POST 'https://api.emmy.ninja/users' \
--header 'Content-Type: application/json' \
--data-raw '{
"locationId": 1,
"birthDate": "1980-01-01",
"gender": 0,
"firstName": "firstName",
"lastName": "lastName",
"email": "mail@example.org",
"password": "password",
"mobilePhone":"000000",
"newsletterAccepted": false,
"agbChecked": false,
"planId": 1,
"languageId": 0
}'
curl --location --request GET 'https://api.emmy.ninja/users/$USER_ID' \
--header 'Authorization: Bearer $ACCESS_TOKEN'
Get interesting facts such as yout total number of rides or the total ridden distance in meters.
curl --location --request GET 'https://api.emmy.ninja/users/$USER_ID/stats' \
--header 'Authorization: Bearer $ACCESS_TOKEN'
List all your previous rentals.
curl --location --request GET 'https://api.emmy.ninja/users/$USER_ID/rentals' \
--header 'Authorization: Bearer $ACCESS_TOKEN'
Show a specific rental by $RENTAL_ID
.
curl --location --request GET 'https://api.emmy.ninja/users/$USER_ID/rentals/$RENTAL_ID' \
--header 'Authorization: Bearer $ACCESS_TOKEN'
When you change you address, the old address is still stored and returnd as part of the user information. The new address will become the new default.
curl --location --request POST 'https://api.emmy.ninja/users/$USER_ID/addresses' \
--header 'Authorization: Bearer $SIGNUP_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"firstName": "John",
"lastName": "Doe",
"street": "street name",
"houseNumber": "99",
"zipCode": "10000",
"city": "city",
"countryCode": "DE"
}'
List current payment options.
curl --location --request GET 'https://api.emmy.ninja/users/$USER_ID/payment-methods' \
--header 'Authorization: Bearer $SIGNUP_TOKEN'
curl --location --request POST 'https://api.emmy.ninja/users/$USER_ID/payment-methods/cc' \
--header 'Authorization: Bearer $SIGNUP_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"number": "number",
"expirationDate": "expDate",
"cardHolder": "cardHolder",
"type": "type",
"cvc": "cvc"
}'
curl --location --request POST 'https://api.emmy.ninja/users/$USER_ID/payment-methods/dd' \
--header 'Authorization: Bearer $SIGNUP_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"accountHolder": "accountHolder",
"sepaMandateCheck": false,
"iban": "iban",
"bic": "bic"
}'
List available signup plan.
curl --location --request GET 'https://api.emmy.ninja/plans'
Sometimes, Emmy notifies its user about recent events such as an increase of prices, offline fleets because of bad weather condidition, etc.
curl --location --request GET 'https://api.emmy.ninja/notifications' \
--header 'Authorization: Bearer $ACCESS_TOKEN'
Get the business and non-parking territories.
curl --location --request GET 'https://api.emmy.ninja/locations'
Emmy is offering prepaid credit packages so that you can lower the price per minute.
$CREDIT_PACKAGE_CODE
.
$CREDIT_PACKAGE_CODE
are known so far. You may try one of the following:
["Asphalteuphoristen", "Gelegenheitsflaneure"]
cmp.
https://emmy-sharing.de/preise/
curl --location --request POST 'https://api.emmy.ninja/credit-packages/buy' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"code": "$CREDIT_PACKAGE_CODE"
}'
Check, if a promotion code is valid an can be redeemed. You need to have a
$PROMOTION_CODE
that you might get from marketing actions. Use SideMenu
for
$REDEMPTION_PURPOSE
. If you want to enter a promotion code from a friend,
use Registration
instead
curl --location --request POST 'https://api.emmy.ninja/promotion-codes/validate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--data-raw '{
"code":"$PROMOTION_CODE",
"redemptionPurpose": "$REDEMPTION_PURPOSE"
}'
curl --location --request POST 'https://api.emmy.ninja/promotion-codes/redeem' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $SIGNUP_TOKEN' \
--data-raw '{
"code": "$PROMOTION_CODE",
"redemptionPurpose": "$REDEMPTION_PURPOSE"
}'
Variable $PLATFORM
must be one of the following: ["android", "ios"]
curl --location --request GET 'https://api.emmy.ninja/verification/onfido-token' \
--header 'Emmy-Application-Platform: $PLATFORM' \
--header 'Authorization: Bearer $SIGNUP_TOKEN'
verification/onfido-token
The response contains a JWT. But what is it used for?