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

Initial API Call

In order to login your subuser, you need to contact our web API to retrieve the unique URL to automatically login your subuser. Then display the generated URL to automatically login your subuser.
Parameter Required Requirements Description
user Yes Must be set in email format This is the subuser you will attempt to automatically login
password No Your subuser password. Authenticate the subuser with this API call.

Call

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

Response

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

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

Call

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

Response

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

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>