Token endpoint URL for SharePoint Online

To connect to SharePoint Online from external application, including Salesforce, you will need the token endpoint URL. This URL has this format:[tenant]/tokens/OAuth/2?resource=[sender ID]/[sharepoint online host name]@[tenant]

Looks simple. You just need to replace tenant, sender ID and sharepoint online host name with real values:

  • Sender ID: 00000003-0000-0ff1-ce00-000000000000
  • Sharepoint online host name: can be found by URL where your site collection is located. For example, if you site collection URL is, host name will be
  • Tenant: is almost the same as host, just “sharepoint” is replaced with “onmicrosoft”. So if my host is, tenant will be

Just replace the values and you will have a valid token endpoint URL to use for connecting your application to SharePoint Online. I will come back in another article with more details about how this is used in authentication and authorization process against SharePoint Online.