Magic Link Authentication
This endpoint allows you to generate a secure magic link that can be used for logging in without a traditional password. The link is active for a limited time (3 minutes) and provides a streamlined user experience.
HTTP Request
- Method:
POST
- URL:
https://api.vinter.me/api/v1/Auth/CreateMagicLink
Request Headers
Header Name | Description | Example Value |
---|---|---|
X-Api-Key | API key for organizational authentication. | api_key |
X-User-Secret-Key | User secret key for organizational user authentication. | user_secret_key |
Content-Type | Specifies the media type of the request. | application/json |
Request Body
The following fields must be included in the request body:
Parameter Name | Type | Required | Description |
---|---|---|---|
firstName | String | Yes | The user’s first name. |
lastName | String | Yes | The user’s last name. |
email | String | Yes | The user’s email address. |
phone | String | Yes | The user’s phone number. |
languageCode | String | Yes | The preferred language for communication. |
mailPermission | Boolean | Yes | Consent for receiving email notifications. |
Example Request Body
{
"firstName": "Kaan",
"lastName": "KIVIRCIK",
"email": "[email protected]",
"phone": "+905555555555",
"languageCode": "tr-TR",
"mailPermission": true
}
Initial Response Format
Upon the first request, a new SecretKey
and MagicLink
will be returned. The MagicLink
is valid for 3 minutes. Subsequent requests using the same SecretKey
will not return a new key but will still return a valid magic link.
Example Response Body (First Request)
{
"Data": {
"SecretKey": "cHXjfI+7gOLBuqAbd62OHA==:OGSrEIkyrzen4IoTsoL8j0OUe0l/Ho3e+kCxRiYZbha1fsrh8UHpFTH7bBdBRiRhEBydIK2UhvbmZm1Osmb3tMz0AYtep+0CTOwecZd5YstURjbKNyll3hvil0vvr4VUjWnatYds5jH6EumUcnkSaswsBV2nH/EGIBLkiTcwjm3CJ5/ZFD+By3AsaXNIhC+eTKmQT8er3ArvW6otZusBsZm7pUWvuxOgheVXpxEU8mz6Ft/fiTNHp8KJLF6U1crP",
"MagicLink": "https://api.vinter.me/loginWithKey?apiKey=BFflidn6j2yTh7ul2pLmpw==:wQLz9jG/T0j6nNHfMCnBMJrekhDaYj6TG5lQ+ikHDcyXcbODkg0wo8wmaFt6isAyzjQWxpRS7P569Cz/GT7sDBKSLy1O03Hca/aaR9ilY20znmDtDCeSGoIm0qUf88s9M+NDQJ0EiF37A+wxmUSj0Es2LZgsvvUVgQzxRvqZnTUzLuD6FRvUV0SGyFkdWN5udZPcbRD3g3ilrtc/60BKhGsK1R81ogCO/pUj7RAH6cNkcbShtLry/4f5+fMRi6NQ"
},
"Success": true,
"Message": null,
"IsResourceKey": true
}
Subsequent Response Format
For subsequent requests using the same SecretKey
, the SecretKey
field will be null. The returned MagicLink
will remain valid for 3 minutes.
Example Response Body (Subsequent Request)
{
"Data": {
"SecretKey": null,
"MagicLink": "https://api.vinter.me/loginWithKey?apiKey=BFflidn6j2yTh7ul2pLmpw==:wQLz9jG/T0j6nNHfMCnBMJrekhDaYj6TG5lQ+ikHDcyXcbODkg0wo8wmaFt6isAyzjQWxpRS7P569Cz/GT7sDBKSLy1O03Hca/aaR9ilY20znmDtDCeSGoIm0qUf88s9M+NDQJ0EiF37A+wxmUSj0Es2LZgsvvUVgQzxRvqZnTUzLuD6FRvUV0SGyFkdWN5udZPcbRD3g3ilrtc/60BKhGsK1R81ogCO/pUj7RAH6cNkcbShtLry/4f5+fMRi6NQ"
},
"Success": true,
"Message": null,
"IsResourceKey": true
}
Detailed Field Descriptions
-
SecretKey:
A unique key generated on the first request. Used to authenticate subsequent requests without re-issuing a new secret key. -
MagicLink:
A secure link for logging in. Valid for 3 minutes. -
Success:
Indicates whether the request was successfully processed. -
Message:
Any additional information or error messages. -
IsResourceKey:
A flag indicating if the response contains a resource key.
Use Cases
-
Passwordless Login:
Provide users with a fast and secure way to log in without remembering passwords. -
Secure Access Control:
Ensure only authorized individuals can generate a valid magic link. -
Streamlined Onboarding:
New users can easily set up their accounts and log in using the magic link, reducing the friction of traditional registration processes.