Skip to content

blue-10/Blue10SDK

Repository files navigation

Blue10 SDK

Nuget

alt text

This is the Blue10 .NET Core SDK.

Request an environment at Blue10

  1. To start using Blue10 you first need an environment and API key. Both will be generated by Blue10 Contact Blue 10.
  2. During the API key creation process our staff will assess which features your application requires and will attach that feature set to your Blue10 environment.
  3. Log in to your Blue10 environment and create a new Company via Settings -> Companies -> New company. Give the company a name and pick the ERP system API. The next screen will directly show, choose the feature set as created in the previous step.

Getting started

For this example we will create a simple console adapter that synchronises vendor information.

1. Create a new Visual Studio project

In the main Program.cs you will see this:

using System;

namespace GettingStartedWithBlue10
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

2. Get the Blue10 Package from nuget

dotnet add package Blue10SDK --version 0.1.5

3. Create a desk

Simple desk

using System;

class Program
{
   static void Main(string[] args)
   {
       //Build our blue10 client service
       var b10client = Blue10.CreateClient("<Your personal API Key>");

       //or the simple async alternative
       var b10AsyncClient = Blue10.CreateAsyncClient("<Your personal API Key>");
   }
}

-OR-

Add a desk to Microsoft.Extensions.DependencyInjection's IServiceCollection

//When configuring ASP.Net Core , Azure Functions or IHosterService projects

public void ConfigureServices(IServiceCollection services)
{
   service.AddBlue10("<Your personal API Key>")
   //..
   //Other services
}

// And then use the client through dependency injection:
public class MyClass
{
   readonly IBlue10AsyncClient client;

   public MyClass(IBlue10AsyncClient _blue10Client)
   {
       client = _blue10Client;
   }
}

4. Upload multiple vendors

using System;

namespace GettingStartedWithBlue10
{
    class Program
    {
        static void Main(string[] args)
        {
            //Build our blue10 client service
            var b10client = Blue10.CreateClient("<Your personal API Key>");

            //retreive your company 
            var myCompanyId = b10client
                .GetCompanies()
                .FirstOrDefault(x => x.id == "<MyCompany>");

            //Create some vendors
            var vendors = new List<Vendor>
            {
                new Vendor{
                        id_company = myCompanyId.id,
                        administration_code = "1",
                        name = "Albert Heijn"
                    },

                new Vendor{
                        id_company = myCompanyId.id,
                        administration_code = "2",
                        name = "Jumbo"
                    },

                new Vendor{
                        id_company = myCompanyId.id,
                        administration_code = "3",
                        name = "Coop"
                    }
            };

            //Add vendors to blue10
            vendors.ForEach(x => b10client.AddVendor(x));

            Console.WriteLine("Done");
        }
    }
}

About

A .Net Standard Library used to communicate with the Blue10 Web API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages