Creates an API token for your MyRent account. Send it in the token header; it is valid for 1 hour.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Creates an API token for your MyRent account. Send the token in the token header of the endpoints that need it (for example Calendar and Price seasonal).
MyRent gives you all values for this call: the API key, your user_guid, user_id, public_key and auth_key. The token expires 1 hour after it is created. Cache it and create a new one shortly before it expires, for example every 45 minutes; do not create a new token for every request.
Base URL of this endpoint: https://auth.my-rent.net.
Headers: Authorization (API key) and user_guid.
Keep the keys on your server
Never put the API key,
public_keyorauth_keyinto browser or mobile app code.
Example request body
{
"user_id": "100",
"public_key": "YOUR_PUBLIC_KEY",
"auth_key": "YOUR_AUTH_KEY"
}
Responses
| Code | Meaning |
|---|---|
| 200 | Token created. |
| 403 | user_id does not match user_guid, or the keys are wrong or not active. |
| 404 | Missing or wrong Authorization header, missing user_guid header, or empty body. No body. |
