The Roles Graph
Guides and API reference materials to help you get started, integrate, and optimize your use of the API platform
Base Example
The Graph-R API provides mutliple endpoints for retrieving, adding, updating, and deleting data. Regardless of the specifics of each endpoint and action, the way you call the API follows the same pattern. Each call consists of:
- A URI, such as "https://api.graph-r.com/roles/<guid>".
- A method, such as "GET", "POST", "PATCH", or "DELETE".
- A header named "SubscriptionName" that contains your subscription name.
- A header named "SubscriptionKey" that contains the key associated with your subscription name.
- An header named "Options" that contains pairs of named options/values, separated by semi-colons. Some API endpoints have no options, some have required options, and some are optional.
Successful calls to each action always return a status of 200 (OK) and a JSON object.
Unsuccessful calls always return a status of 400 (Bad Request) and a JSON object that indicates the exception that has occurred.
C# Example
The following code shows a typical C# call to the API:
WebRequest request = WebRequest.Create("https://api.graph-r.com/search"); request.Method = "GET"; request.Headers.Add("SubscriptionName", "MY_ORG_NAME"); request.Headers.Add("SubscriptionKey", "MY_ORG_KEY"); request.Headers.Add("Options", "Terms=Blockchain Consensus;ExactMatch=true;"); try { using (WebResponse response = request.GetResponse()) { string status = ((HttpWebResponse)response).StatusDescription; if (status.ToUpper() == "OK") { using (Stream dataStream = response.GetResponseStream()) { StreamReader reader = new StreamReader(dataStream); string responseFromServer = reader.ReadToEnd(); //If a single object is expected var data = JObject.Parse(responseFromServer); //OR if a collection is expected: //var data = JArray.Parse(responseFromServer); //TODO: Work with the 'data' object here } } else { //TODO: Handle any bad requests } response.Close(); } } catch (Exception ex) { //TODO: Handle any exceptions }
The table below describes each of the actions in detail, including the parameters, the Options header, and the type of JSON object returned.
You can see the class definitions used to generate the JSON objects here.
You can see the data here.
API Name |
---|
AdjacentRolesView the methods and options for using the AdjacentRoles API
|
AdjacentSkillsView the methods and options for using the AdjacentSkills API
|
AlphaRolesView the methods and options for using the AlphaRoles API
|
AlphaSkillsView the methods and options for using the AlphaSkills API
|
ConceptsView the methods and options for using the Concepts API
|
RoleGroupsView the methods and options for using the RoleGroups API
|
RolesView the methods and options for using the Roles API
|
SearchView the methods and options for using the Search API
|
SkillsView the methods and options for using the Skills API
|
SubscriptionView the methods and options for using the Subscription API
|
TagsView the methods and options for using the Tags API
|
TaxonomiesView the methods and options for using the Taxonomies API
|