https://app.eaglebe.com/api 

How to Integrate with Eagle

To provide secure access to the Eagle API, we use OpenID connect and the OAuth2 protocol. 
At the moment only the 'Client credentials flow' of OAuth is supported. 
This allows a secure 'server 2 server' connection between the client (third party application) and the Eagle API.


What do you need?

To use the Eagle API you need a client_id. To get a client_id, send an email to Eagle with the following information:

  • Uw client_id moet minimaal uit 5 karakters bestaan en mag geen spaties, of andere speciale karakters bevatten.
  • Scope: EagleWrite of EagleWrite of EagleRead

  • Technical contact: name, email and phone number

After the request we will send you a Client Secret with which you can test your integration on our Beta environment. As soon as your tests are successfully completed, you can send us a request to put the client_id into production.


Collecting a token via Eagle STS

To be able to access the Eagle API you need a token (bearer), which you can request from the Eagle STS using your client_id, client_secret and the desired scope.

Below an example (c#) of a request operation to request a token:


static TokenResponse GetClientToken()
{
    var client = new TokenClient(
        "https://beta.app.eaglebe.com/sts/connect/token",
        "client_id",
        "client_secret");
                     
    return client.RequestClientCredentialsAsync("Scope").Result;
}

Calling Operation in Eagle API

After you have received an access token you can use it to invoke an operation in the Eagle API.

Below is an example (c#) that shows you how to call an operation in the API:


static async Task< string > CallApi(TokenResponse response)
{
    var client = new HttpClient();
    //Gebruik de aangevraagde token 
    client.SetBearerToken(response.AccessToken);
    var myContact = JsonConvert.DeserializeObject({...});
    var result = await client.PostAsync("https://beta.app.eaglebe.com/api/CreateEagleContactForAanvraag", 
        new StringContent(JsonConvert.SerializeObject(myContact).ToString(), Encoding.UTF8, "application/json"));
    if (result.IsSuccessStatusCode)
    {        
        return JsonConvert.DeserializeObject(result.Content.ReadAsStringAsync().Result);
    }
    else
    {
        return string.Format({0}: {1}, result.StatusCode, result.Content.ReadAsStringAsync().Result;
    }       
}