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
The simplest way to see how the API works, is by using Fiddler
o365admin@mydomain.com:o365password
would encode to bzM2NWFkbWluQG15ZG9tYWluLmNvbTpvMzY1cGFzc3dvcmQ=
https://yellowshoe-admin-365-v1.p.mashape.com/o365/msoluser
X-Mashape-Key: <your-mashape-api-key>
X-OnlineServiceCredentials: <base64-encoded-Office-365-administrator-credentials>
(e.g. X-OnlineServiceCredentials: YXBpdXNlckBteWRvbWFpbi5jb206YXBpcGFzc3dvcmQ=
)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.
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.
HTTP PUT
requestExecuting 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.
Content-Type: application/json
to the Request Headers{"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/
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)