Lookup email
Check if user exists on Link network
Quick example: https://loginwithlink.com/api/[email protected]&STRIPE_PUBLIC_KEY=pk_live_51JocsEAGmp0k5LnwNUl7SJzZMhMMcMJ4X4PWg928nJLm5ocPpzHLhBOBMbTLBrXPYdkepbg9HX0AJFY8ixt2bXTV00vg5Ja3DP <- That uses my public key — please use your own once you get the idea!
Request
This is a GET request.
GET https://loginwithlink.com/api/lookup-emailInclude the following query parameters
Parameter
Example
STRIPE_PUBLIC_KEY
pk_live_51JocsEAGmp0k5LnwNUl7SJzZMhMMcMJ4X4PWg928nJLm5ocPpzHLhBOBMbTLBrXPYdkepbg9HX0AJFY8ixt2bXTV00vg5Ja3DP
In total, your request will look like this
GET
https://loginwithlink.com/api/[email protected]&STRIPE_PUBLIC_KEY=pk_live_51JocsEA_YOUR_KEY_HEREe.g., if using `fetch`, you might compose a request like so:
const url = "https://loginwithlink.com/api/lookup-email";
const queryParams = {
email: "[email protected]",
STRIPE_PUBLIC_KEY: "pk_live_51JocsEAGmp0k5LnwNUl7SJzZMhMMcMJ4X4PWg928nJLm5ocPpzHLhBOBMbTLBrXPYdkepbg9HX0AJFY8ixt2bXTV00vg5Ja3DP"
};
const queryString = Object.entries(queryParams)
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
.join("&");
const fullUrl = `${url}?${queryString}`;
fetch(fullUrl)
.then(response => response.json())
.then(data => {
// Handle the response data here
console.log(data);
})
.catch(error => {
// Handle any errors that occur during the fetch request
console.error(error);
});Response
The response will look something like this, if a match is found:
You will see "userExistsOnLink": false if user is not found on Link.
Last updated