How it works...
The JSON method actually carries less overhead in terms of setting up the calls than SOAP. We don't need to set up any bindings; we just need to set the Authorization header property, which is easily done using this method.
The rest is generic JSON, and the code we write is the same as if we were writing for any other application that is able to use this method.
The difficult part is setting up the C# classes in which to deserialize to, or serialize from. It isn't obvious at first, especially when a simple list of names, such as ServiceGroups, requires two classes. Thankfully, Newtonsoft have written a great NuGet package that means a lot of the work is done for us. We can also cheat a little by using SOAP to generate classes ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access