To authenticate, add an
Authorization header to your API
request that contains an API Key.
SendGrid’s Web API v3 supports the use of API Keys. API Keys allow you to use another method of authentication separate from your account username and password. API Keys add an additional layer of security for your account and can be assigned specific permissions to limit which areas of your account they may be used to access. API Keys can be generated in your account - visit https://app.sendgrid.com/settings/api_keys. To use keys, you must set a plain text header named “Authorization” with the contents of the header being “Bearer XXX” where XXX is your API Secret Key.
The on-behalf-of header allows you to make calls for a particular subuser through the parent account; this can be useful for automating bulk updates or administering a subuser without changing authentication in your code. In the header you are passing, you will simply need to add:
This will generate the api call as if it was the subuser account itself making the call. Just make sure you are using the correct subuser username.
When authenticating using the on-behalf-of header, you will need to use the API key credentials of the parent account.
1 2 3 4 5 6
Please note: The on-behalf-of header will not work with the