Azure AD (Office 365) already has a REST API (https://developer.microsoft.com/en-us/graph/) so this is really for on-prem Active Directories.
On-prem Active Directory also has AD Web Services (https://technet.microsoft.com/en-us/library/dd391908(v=ws.10...) that I guess you could use instead of this, but a simple rest api like this will be easier to integrate with.