Authenticate Shared User
POST/user
Upserts a user in the system and returns a unique `user_uid` and `x-access-token` header for authentication (that expires after 6 hours).
This is the preferred authentication method for partners sharing user information with LetMePark.
Users entered via this API are effectively "owned" by the partner entering the details, giving it further write privileges through this entry-point so it can be called multiple times for the same user, updating their details (using email as identifier - two different emails are two different users).
If a user exists but is "owned" by another partner, or by LetMePark, it will return a `409 Conflict` status and a fake `x-access-token`.
Request
Header Parameters
HTTP header that identifies the partner system making this call. Please contact LetMePark for your x-partner-key
if you are considering user-level integration.
An integration test header to skip normal execution and force a particular HTTP status response (ie 200
, 400
, 404
, 500
). Can be used in ALL entry points even if not explicitly mentioned.
- application/json
Body
required
User details
Users first name
Users last name
Users email address
A password or token for this user that will not change. Ideally, a unique identifier for this user in the thirdparty system.
User phone number (without spaces)
User CIF/NIF (for invoicing).
User Billing Address (for invoicing)
Number plate (UPPERCASE, without spaces)
The brand of the primary vehicle (required if sending number_plate
)
The model of the primary vehicle (required if sending number_plate
)
Possible values: [0
, C
, B
, ECO
]
The environmental tag for the users car (ie C)
Responses
- 200
- 400
- 401
- 409
- 500
OK
- application/json
- Schema
- Example (from schema)
Schema
A unique identifier for this user
An x-access-token
header for authenticating this user in further API calls, can also be used as the access_token
for auto-login via the website. Expires after 6 hours.
If the user has a valid payment method
{
"user_uid": "29a7ca912f49",
"x-access-token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiJlMmQwNDJkZWFhN2IiLCJlbWFpbCI6ImZpbGVtb24ucGlAbGV0bWVwYXJrLmFwcCIsInJvbGUiOiJ1c2VyIiwiaWF0IjoxNjA2MTMwMDY2LCJleHAiOjE2MDY4NTAwNjZ9.Va35NcvT0rqUcbZAuDQl81MBvbPwNHluf7dA8oifooE",
"has_payment_method": true
}
Bad request (ie. Missing email/password/number_plate)
Unauthorized (ie. Invalid 'x-partner-key')
Conflict (ie. Partner cannot update that user)
Internal server Error