To connect to SharePoint Online from external application, including Salesforce, you will need the token endpoint URL. This URL has this format:

https://accounts.accesscontrol.windows.net/[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 https://companyname.sharepoint.com/sites/sprint, host name will be companyname.sharepoint.com.
  • Tenant: is almost the same as host, just “sharepoint” is replaced with “onmicrosoft”. So if my host is companyname.sharepoint.com, tenant will be companyname.onmicrosoft.com.

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.