Admin 365

FREEMIUM
By yellowshoe | Updated לפני 9 ימים | Tools
Health Check

N/A

README

The Yellowshoe Admin 365 API for Office 365 enables the execution of configuration requests against Office 365 tenants using REST/JSON.

The products manageable using the API are: Exchange Online, SharePoint Online and the top-level Office 365 tenant.

By providing a web-standards (HTTP/JSON) REST-based Web-API for Office 365, the Yellowshoe API for Office 365 makes developing applications that work with Office 365 a whole lot easier

Getting started

The simplest way to see how the API works, is by using Fiddler

What you need:

  1. Your Mashape Key
  2. An administrator-level account login for Office 365

Getting started:

  1. Take your your Office 365 administrator credentials and encode them using base64 encoding, using the format username:password. For example o365admin@mydomain.com:o365password would encode to bzM2NWFkbWluQG15ZG9tYWluLmNvbTpvMzY1cGFzc3dvcmQ=
  2. You should now have two base64 encoded credentials. Time to put them into Fiddler, so open a composer tab
  3. In the URL, enter https://yellowshoe-admin-365-v1.p.mashape.com/o365/msoluser
  4. In the request body, under User-Agent, add a line that says X-Mashape-Key: <your-mashape-api-key>
  5. Add another line that says: X-OnlineServiceCredentials: <base64-encoded-Office-365-administrator-credentials> (e.g. X-OnlineServiceCredentials: YXBpdXNlckBteWRvbWFpbi5jb206YXBpcGFzc3dvcmQ= )
  6. Hit execute
  7. And you’re done!

API REST Commands

The API commands are mapped to the standard Office 365 PowerShell commands, minus the <action>- prefix. In the example above, we performed the equivalent of a Get-MsolUser PowerShell command (https://yellowshoe-admin-365-v1.p.mashape.com/o365/msoluser). We could also perform a GET request against https://yellowshoe-admin-365-v1.p.mashape.com/o365/msoldomain, for the equivalent of Get-MsolDomain; https://yellowshoe-admin-365-v1.p.mashape.com/o365/msolrole for the equivalent of Get-MsolRole etc.

GET vs PUT

HTTP GET commands map to PowerShell Get-<cmd> commands. So what about Add- Remove- New- etc? These are mapped to HTTP PUT requests.

To correctly determine what action you want to perform, you need to specify the desired action in the URI. So building on the example above, executing an HTTP PUT request against https://yellowshoe-admin-365-v1.p.mashape.com/o365/msoluser/new will result in the equivalent of a New-MsolUser PowerShell command. Similarly, executing an HTTP PUT request against https://yellowshoe-admin-365-v1.p.mashape.com/o365/msoluser/remove will result in the equivalent of a Remove-MsolUser PowerShell command.

Executing a HTTP PUT request

Executing a HTTP PUT request works much the same as the Getting Started example, except we ask Fiddler to execute a HTTP PUT instead of the default: HTTP GET.

To successfully complete an HTTP PUT request, the API needs some additional information in order to complete the request successfully. Those parameters are provided within the body of the PUT request, using the JSON format.

  1. Configure Fiddler as per the Getting Started example above.
  2. Change the HTTP command from GET to PUT.
  3. Add the line Content-Type: application/json to the Request Headers
  4. In the Request Body, enter the following: {"Parameters":[{"ParameterName":"DisplayName","Value":"Example User"},{"ParameterName":"UserPrincipalName","Value":"exampleuser@myO365domain.com"}]}

The parameter names and accepted values map to their PowerShell equivalents.

To get a list of available commands and their parameters, execute a GET request for https://yellowshoe-admin-365-v1.p.mashape.com/commands/

Exchange Online API and SharePoint Online API

In addition to the top-level Office 365 Administration, the Office 365 API also enables you to administer Exchange Online and SharePoint.

Executing commands against the Exchange Online API and SharePoint Online API works in the same way as the Office 365 API. Instead of https://yellowshoe-admin-365-v1.p.mashape.com/o365/{resource}/{action}, use https://yellowshoe-admin-365-v1.p.mashape.com/exchange/{resource}/{action} and https://yellowshoe-admin-365-v1.p.mashape.com/sharepoint/{resource}/{action} respectively.

({action} is only applicable to HTTP PUT requests)
Followers: 2
Resources:
Product Website
API Creator:
Y
yellowshoe
yellowshoe
Log In to Rate API
Rating: 5 - Votes: 1