NAV
ruby powershell
  • Introduction
  • Authentication
  • Signatures
  • Active Directory
  • Introduction

    The Sigilium API V3 uses the standard OAuth2 protocol.

    Authentication

    Use the access_token in your Company settings

    Every administrator has an access_token ready to use in the admin section (via Settings > Company Settings). You can use it directly to have signatures from the Sigilium API V3.

    Get an access_token with classic OAuth2 flow

    If your want to provide Sigilium integration in your app:

    # the code is on the callback
    # params[:code] = "34553.."
    
    # These variables come from Sigilium. Ask contact@sigilium.com
    APPLICATION_ID = "ABC..."
    APPLICATION_SECRET = "123.."
    
    client = OAuth2::Client.new(APPLICATION_ID, APPLICATION_SECRET, site: "https://sigilium.com")
    # https://me.com/api/me is an example to redirect the user after getting the access_token.
    token = client.auth_code.get_token(params[:code], redirect_uri: "https://me.com/api/me")
    
    token_hash = token.to_hash
    
    access_token = token_hash[:access_token]
    

    Signatures

    HTTP Request

    GET https://sigilium.com/api/v3/signatures

    Query Parameters

    Parameter Default Description
    emails none Commat separated list of emails. Example: email1@example.com,email1@example.com
    access_token none The access_token form the Authentication
    link = "https://sigilium.com/api/v3/signatures?output=html&emails=#{emails}&access_token=#{access_token}"
    signatures = JSON.parse(open(link).read)
    

    The above command returns JSON structured like this:

    {
      "signatures": [
        {
          "email": "example@example.com",
          "html_content": "\u003ctable style=\"sigiliumSignature:true\"\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003e\u003ca href=\"https://sigilium.test/signatures/rck1fdsklktM8JDTu4jaorc/link\"\u003e\u003cimg src=\"https://sigilium.test/signatures/rcAQfNocKOlfmis9R0TG1aG0S4rF8rc/150/image.jpg\" style=\"max-height: 150px; max-width: 450px; height: 150px !important; width: 450px !important; border: 0; outline: none; color: #9ec500\" width=\"450\" height=\"150\" alt=\"Marina Loiseau - Légende - +33 1 83 64 02 13\"\u003e\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e"
        }
      ]
    }
    

    Active Directory

    HTTP Request

    POST https://sigilium.com/api/v3/active_directory

    Query Parameters

    Parameter Default Description
    users none An array of users
    user fields none mail, givenname, surname, jobtitle, phone, mobilephone, streetaddress, postalcode, city, organizationname
    access_token none The access_token form the Authentication

    For user fields , only the mail param is mandatory. All other fields can be omitted. If more fields are provided , they will be ignored. If you need we can activate custom fields for your organization: contact@sigilium.com

    curl -H "Content-Type: application/json" -X POST -d '{"access_token":"YOURACCESSTOKEN","users": [{"mail": "test@email.com", "jobtitle": "tester"}, {"mail": "test2@email.com", "jobtitle": "developer"}]}' https://sigilium.com/api/v3/active_directory
    
    

    The above command returns an http 201 accept header

    File upload

    You can also upload a json file with the users data

    A sample file can be seen here

    You also can upload a csv (';' separated and utf-8 encoded)

    See our sample csv file

    curl -F 'file=@/filepath/filename.json'  -X POST https://sigilium.com/api/v3/active_directory/file
    
    
    $accessToken = "YOURACCESSTOKEN"
    $filename = "sigilium.csv"
    
    function Upload-CSV($token, $filePath){
      $usersCsvFile = Get-Item -Path "$filePath"
      $fileEndpoint = "https://sigilium.com/api/v3/active_directory/file"
      $Auth = "Bearer $token "
    
      Write-Host "Will upload CSV to Sigilium"
      $wc = new-object System.Net.WebClient
    
      $wc.Headers.Add("Authorization", $Auth)
      $byteRes = $wc.UploadFile($fileEndpoint, $usersCsvFile)
      $response = [System.Text.Encoding]::UTF8.GetString($byteRes)
      Write-Host $response
    }
    
    
    Upload-CSV $accessToken $filename
    

    The above command returns an http 201 accept header