Allow customers to manage their account from your website using an iframe to our site.

Initial API Call

In order to login your customer, you need to contact our web API to retrieve the unique URL to automatically login your customer. Then display the generated URL to automatically login your customer.

Parameter Required Requirements Description
user Yes Must be set in email format This is the customer you will attempt to automatically login
password No Your customer password. Authenticate the customer with this API call.
method Yes Must be set to geturl Allows you to access automatic login functionality

Call

POST https://api.sendgrid.com/apiv2/reseller.manage.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=geturl&user=customer@example.com

Response

1
2
3
{
  "params": "al_username=username&al_subuser_name=customer@example.com&al_hash=aa39649af578679d3a90d2cc43245d56"
}

Call

POST https://api.sendgrid.com/apiv2/reseller.manage.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=geturl&user=customer@example.com

Response

1
2
3
4
5
<?xml version="1.0" encoding="ISO-8859-1"?>

<params>
   <params>al_username=username=customer@example.com=b478ab36ebc306990dd283b1c341898e</params>
</params>

iFrame Usage

Using the parameters returned from the Initial API Call, you can construct the iFrame URL as shown below.

1
<iframe src="https://sendgrid.com/account?al_username=username&al_subuser_name=example@example.com&al_hash=aa39649af578679d3a90d2cc43245d56"></iframe>
Was this helpful?