Don't be afraid of REST API - Introduction to REST API for "greenhorns"

Modified on Thu, 13 Jun at 9:05 AM

We don't all do integrations every day. That's why we have prepared a crash course on integration in today's world, where we briefly mention the most important concepts and tools for integration using the REST API.



Basic principles and concepts

What a person needs to have in his head to understand things around API:


The basic principle of REST API calls - when a call is made, a request is sent over the HTTP Internet protocol - HTTP Request, and the caller receives the HTTP Response back over the HTTP protocol.


Postman

Postman is a service that allows you to text REST API calls in a very friendly, easy to understand environment. You can easily organize different calls, for each call you can clearly enter the address, call type, head, authorization, points, you can also see the results of the call. It is also used by Signi at https://signiapi.postman.co/.


Call

For each call you make:

  • The HTTP Request type, typically GET or POST, is selected in the request header.

  • The request header also includes the endpoint address is in the case of the Signi API, for example, it has an endpoint to send a file to the signature https://api.signi.com/api/v1/contract/.

  • In cases where the enpoind has parameters, they are specified on the Param tab, In the case of the Signi API e.g. the file creation endpoint has a Type parameter with the value "doc" i.e. the resulting address of the call is https://api.signi.com/api/v1/contract/?type=doc.

  • On the Authorization tab, API Key is selected as the authorization type and the API key workspace is given as the x-api-key value and the API key location is selected as Header. To generate an API key for your workspace in Signi, follow the instructions for Generating an API Key.

  • On the Body page, multipart/form-data is selected as the call type and one or more Keys are specified, which can be either text or file type. In the case of an endpoint to upload a file for signature, at least two are assumed, data and uploaded_file_key. Note that both are of type file, so that the files are actually physically transferred to the HTTP request. The first one is JSON with the parameters of the endpoint call, the second one is the file to be signed - PDF or DOC, DOCX, XLS, XLSX, HTML. For each key you need to select the parameter type is File, Click "Select Files" to open the file selection, insert the appropriate one.

  • The Send button sends the request to the corresponding REST API. The bottom result panel shows the result of the call i.e. the contents of the HTTP Response.

  • The Save button saves the request to Postman for reuse.


Param tab


Autorization tab


Body tab


The keys on the Points tab are of type "File", the file to be sent in the request is selected from your disk and uploaded via "Select Files".


Result

  • After sending the request using the Send button, the result of the endpoint call of the given REST API is displayed in the bottom result pane. i.e. the contents of the HTTP Response.

  • In case of success, the code 200 appears with the appropriate comment. In case of error, typically code 4xx or 5xx. Pi calls to the Signi API are most common with the following errors.


The result of the endpoint call.


Curl

If you're more of a command line person, Curl might be a good fit for testing REST API calls. Curl is an open source program for transferring data over various Internet protocols. Its commands are used to describe how what data is transferred during integration. As well, the commands can be executed in the program.


Curl is usually already part of the operating system - e.g. MS Windows, where it is launched from the Command Prompt application, which is launched by searching for "cmd" in the search box on the desktop.


Curl command run from the command line on MS Windows and its result.


Examples of Signi API calls 

Once you've worked through the basics of the REST API, you can move on to the API Call Examples or Advanced Signi API Call Examples. If you're still stumped, email us at  help@signi.com.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article