Say Hello to Trolley’s Full Featured SDKs
By: Aman Aalam • 5 min read • 904 wordsPosted on March 22, 2024
Did you know Trolley offers SDKs in 6 different programming languages? This post looks at the Trolley SDKs, which can help your team move fast with your integration with our API.
Trolley APIs allow our customers to integrate Trolley directly into their systems. However, integrating any API requires writing a lot of code oneself, which can often extend the time needed to build the integration. This is where Trolley’s SDKs come in handy, significantly reducing the amount of manual coding.
Trolley’s SDKs are offered in 6 different programming languages: Javascript, Ruby, PHP, Python, Java, and .Net (C#).
In this post, we’ll see how, through an example, our SDKs reduce the effort, their API coverage, and where to find them.
When making an API call, multiple steps are performed, many of which multiple times, throughout the codebase (network requests, parsing of responses, etc.)
When using our SDKs, Trolley users avoid this duplication of effort, speeding up overall integration time. Using the SDKs also reduces the chances of running into API errors, letting you focus on other things that really matter.
Let’s compare fetching all recipients via an API call manually coded in Java and then the Trolley Java SDK to see how our SDKs can reduce the effort.
As you can see, from 70+ lines of code trying to access Trolley APIs with plain Java to less than 10 using Trolley’s Java SDK.
Additionally, the SDKs try to extend some functionalities and make things even easier for you. For example, the SDK sample code auto-paginates, so that you don’t have to do it on your own.
These steps help our customers focus on building integration features rather than figuring out how to get API calls working.
While there will still be cases where you will want to use our APIs directly to build even more complex user flows and experiences, the SDKs will significantly reduce the effort in handling the rest.
We have spent a fair amount of effort throughout 2023, releasing major updates to all our SDKs. All of our SDKs are at parity with our public APIs, covering all potential endpoints and features.
Going forward, all SDKs will cover new API endpoints/updates as they become available.
The documentation available at developers.trolley.com contains API documentation, request & response samples, and code samples for all different SDKs.
So, for most actions, you can copy the code samples from the documentation and adapt them according to you needs.
All our SDKs are available from the leading package managers of the respective programming languages.
Here’s a list detailing where to find the SDKs and how to install them
Package Manager Link: | https://www.npmjs.com/package/trolleyhq |
Github Repository: | https://github.com/trolley/javascript-sdk |
Installation Instruction: | npm install --save trolleyhq |
Package Manager Link: | https://rubygems.org/gems/trolley |
Github Repository: | https://github.com/trolley/ruby-sdk |
Installation Instruction: | gem install trolley |
Package Manager Link: | https://packagist.org/packages/trolley/core |
Github Repository: | https://github.com/trolley/php-sdk |
Installation Instruction: | composer requires trolley/core |
Package Manager Link: | https://pypi.org/project/trolleyhq/ |
Github Repository: | https://github.com/trolley/python-sdk |
Installation Instruction: | pip install trolleyhq |
Package Manager Link: | https://www.nuget.org/packages/trolleyhq |
Github Repository: | https://github.com/trolley/dotnet-sdk |
Installation Instruction: | PM> Install-Package trolleyhq |
Package Manager Link: | https://central.sonatype.com/artifact/com.trolley/java-sdk/ |
Github Repository: | https://github.com/trolley/java-sdk |
Installation Instructions: |
<dependency>
<groupId>com.trolley</groupId>
<artifactId>java-sdk</artifactId>
<version>{LatestVersion}</version>
</dependency>
Having more options when it comes to integrating with Trolley will always give more flexibility. We strongly believe using the SDKs will make one’s Trolley integration quicker and more predictable.
Trolley developers often integrate Trolley services deeply with their systems, as I have observed personally. My hope is that this article will display the value the SDKs can bring, and show how to get started with them.
All of our SDKs are open-sourced, and if you have any improvements, we welcome pull requests.
For any other questions or if your team faces any issues, write to us at developers@trolley.com.