Alopeyk.Net Documentation

Alopeyk.Net is a simple wrapper for alopeyks' API for .NET with a full async implementation.

  • It is in compliance with docs.alopeyk.com as of August 2020.
  • Comments are copied from the original documentation.

Alopeyks' APIs sometimes are inconsistent, so this library tries to abstract these inconsistencies. Also some of values in responses are not documented.

Installation

  • Packages are available on nuget.org, installation instructions available on nugets' website.
      dotnet add package Alopeyk.Net
    
  • If you'd like to have the code instead of a pre-built library, you could use gits' submodule ability.

    Just type this command where you want to include the submodule:

      git submodule add git@github.com:amkherad/Alopeyk.Net.git --name Alopeyk.Net
    

How to use

You would access APIs through IAlopeykClient interface which is implemented in AlopeykClient class. You could register it in your dependency container and inject IAlopeykClient interface.

services.AddScoped<IAlopeykClient, AlopeykClient>();

Environment

Alopeyk has two environments the main is production environment but it also provides a sandbox environment. Depending on environment you could provide appropriate URIs or values for the AlopeykClient. (n.b. AddAlopeyk() method takes care of these environmental variables.)

AlopeykClients' Documentation

API Rate Limits

Alopeyk has API-call rate limitations.

  • Our API is limited Per IP. Rate limiting of the API is primarily structured on a per-user basis, but all requests made before being authenticated are rate limited by the IP source of that request.
  • Our main limit factors are Request Per Minute and Request Per Day. If you pass any of these two rate limitations, your access will be limited or blocked for a specified time window, so you'll have to wait until that duration is over.
  • Minutely Rate Limit
    • Currently you can send up to 100 requests every minute. You will be able to check the current quotas on every response header.
  • Daily Rate Limit
    • Currently you can send up to 43200 requests every day. You will be able to check the current quotas on every response header.

Alopeyk.Net puts these values in response of each call. (they're of BaseResponseDtos' type)


Integration with Asp.Net

Alopeyk.Net.AspNet was made to allow integration with Asp.Net, you could simply call services.AddAlopeyk()

services.AddAlopeyk(config => {
    config.Environment = AlopeykEnvironments.Sandbox;
    config.Timeout = TimeSpan.FromSeconds(20);
    config.Token = "XXX";
    config.JsonSerializer = new AlopeykJsonNetJsonSerializer();
    config.AddRetry()
        .AddDelay(TimeSpan.FromSeconds(5))
        .SetRetryCount(2);
});

AlopeykClient

Here's a list of methods available:

  1. GetLocation
  2. GetLocationSuggestions
  3. GetPrice
  4. GetPrices
  5. InsertOrder
  6. GetOrderDetails
  7. UpdateOrder
  8. CancelOrder
  9. RateOrder
  10. AddHiddenDescription
  11. DeleteHiddenDescription
  12. GetLiveMapLink