Getting started with the API

1. Access to the API

In order to use the API, you will need a client account. Please, generate and send us your RSA Key to access the sandbox environment (Warning: PKCS8 only. PuttyGen does not generate a PKCS8 format).

To use the API, you need to append the partner ID and method URL to the root URL and make an HTTP request. For example, if you have a partnerID “123”, to get the user number 1 by using the method /user/1, you need to initiate an HTTP GET request to the URL:

https://api.leetchi.com/v1/partner/123/users/1

The API’s root URL for live environments is:

https://api.leetchi.com/v1/partner/

The API’s root URL for testing environments is:

http://api-preprod.leetchi.com/v1/partner/

2. Generate your RSA key (3 ways)

Install OpenSSL Win32 (http://gnuwin32.sourceforge.net/packages/openssl.htm)

In the directory « bin » (generally located in : « C:\Program Files (x86)\GnuWin32\bin« ) , run as administrator the executable openssl.exe

In the resulting prompt, type these 3 following commands :

genrsa -out PrivateKey.key 1024 -outform DER
pkcs8 -topk8 -nocrypt -in PrivateKey.key -out PrivateKey.pk8
rsa -in PrivateKey.key -out PublicKey.key -pubout

You should now have an output close to this:

OpenSSL> genrsa -out PrivateKey.key 1024 -outform DER
Loading 'screen' into random state - done
Generating RSA private key, 1024 bit long modulus
....................++++++
...............++++++
e is 65537 (0x10001)
OpenSSL> pkcs8 -topk8 -nocrypt -in PrivateKey.key -out PrivateKey.pk8
OpenSSL> rsa -in PrivateKey.key -out PublicKey.key -pubout
writing RSA key
OpenSSL>

Your keys should be generated in the same /bin folders used to run openssl.exe.
Keep the .key files safe, and send us your PublicKey.key

 

Firstly, generate your private key:

dev$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/dev/.ssh/id_rsa): example
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in example.
Your public key has been saved in example.pub.
The key fingerprint is:
86:f6:d4:7c:eb:7b:e7:29:28:74:19:49:60:ce:06:c0 dev@dev.local
The key's randomart image is:
+--[ RSA 2048]----+
|    .... o.      |
|     E  =  .     |
|         +. .    |
|       ..o o     |
|      o S o +    |
|     . + . + .   |
|        o . o    |
|         . o .. o|
|          . oo.+.|
+-----------------+
dev$

Then extract your public key to PEM format:

dev$ ssh-keygen -e -f example -m PKCS8 > example.pem
dev$
Firstly, generate your private key:

dev$ openssl genrsa 2048 > example
Generating RSA private key, 2048 bit long modulus
.....+++
.....................................................................................
.....................................+++
e is 65537 (0x10001)
dev$

Then, extract your public key:

dev$ openssl rsa -in example -pubout > example.pem
writing RSA key
dev$

3. Send us your Public RSA Key (PEM & PKCS8)

(formulaire 'form-2' non trouvé)
Back to Top