“long exposure photography of road and cars” by Marc-Olivier Jodoin on Unsplash

API & DX Changelog #2

Nicolas Grenié
Typeform's Engineering Blog
4 min readSep 24, 2018

--

Barcelona 🏖 might be in a really idyllic place when summer comes but it does not mean our engineers spent their whole days at the beach enjoying cubatas.

No, no, no… Everybody was busy shipping a lot of shiny new cool things to make your developer life easier. 📦

I am sure you are dying to know more about it… Also, I promised over two months ago that this is becoming something regular, so I am happy to introduce you to API and DX Changelog #2!

Login with Typeform buttons 🔐

People are now used to seeing buttons saying “Login with Facebook” when they want to create account on a third party application or share information from their Facebook account.

For years now, Facebook and others have been offering tools to help developers integrate their solution in a breeze. They offer a consistent experience to end-users while keeping the whole thing on-brand.

We wanted to provide something similar with our new Login with Typeform button.

Using the following code snippet you can now start the oAuth journey easily.

<script type="text/javascript" src="https://public-assets.typeform.com/public/oauthbtn/btn.min.js" name="tf-login-button" data-scope="{your_scopes}" data-redirect_uri="{your_redirect_uri}" data-state="{state}" data-client_id="{your_client_id}"></script>

How it will look:

New Login-with-Typeform button

Delete Responses via API 🔫

Our Responses API could do a lot of things already, but there was one little thing missing that a lot of folks asked for: the capacity of deleting responses via API.

We heard you and it’s now possible! 🎉

Here is an example of a call to delete responses:

curl -X DELETE \
'https://api.typeform.com/forms/{form_id}/responses?included_tokens={response_token1},{response_token2},{response_token3}' \
-H 'Authorization: Bearer {access_token}' \

Keep in mind that you can delete up to 1000 responses per API call. Check documentation here for more info!

Improve documentation about pagination 📖

Speaking about our Responses API, we saw some of you getting confused by the way we are doing pagination.

We don’t use the typical page={#page_number} syntax used by a lot of other APIs. Instead, we want to give developers more freedom. For instance, you are able to search for responses by date using parameters like since and until, and we also offer a way to find responses that happened before or after a certain response using its token as reference.

Thanks to your feedback we realized that this part of our documentation was confusing, so we tried to put more context and examples around it.

You can now look at the walkthrough page to find all the examples you need to master pagination on Responses API. 📄📄📄📄📄🎉

Release Javascript SDK 🛠

According to StackOverflow Developer Survey 2018, Node.js is the most popular framework among developers, and at Typeform we are heavy users of many JavaScript frameworks to deliver the app you use everyday.

It was only natural for us to offer to our developer community a robust JS SDK. This is the sole work of our awesome Jepser. Please make sure to file an issue on Github if you find a bug, or have a feature request. External contributions are warmly welcomed 😄

Eventually in the future we will offer more SDKs in other languages, so let us know which one you use. And if you build your own SDK for Typeform APIs, we would love to support you, and promote it here and on our Developer Portal 😉

Checkout JS SDK on NPM 🔗

oAuth token expiration 💣

Security of our users and their data is a priority for us. It also means we want to offer all the tools to our partners to build secured applications that Typeform users can trust.

Using refresh tokens is becoming a standard in the industry, and many other platforms have a similar implementation.

We are adding our little bit to a more secure world by implementing an expiration date on oAuth token that we are issuing. From now on, all the oAuth tokens will expire after one week.

In the oAuth flow, we now return both an expires_in and refresh_token properties in addition to the access_token. You can use expires_in to predict when the token will expire, and use refresh_token to ask for a new access token.

All the steps are describe in this documentation.

Once again, we had a pretty packed edition of our API and DX Changelog. Our team is dedicated to offer developers the best experience possible when interacting with our Platform, so many other things are always happening behind the scenes and bigger improvement are coming soon, but that will be for #3.

Until then, keep hacking! And let us know if you find a bug or a typo anywhere, we are listening 🧐

🎵 Sweet dreams are made by geeks, who are we to ditch a PR? We travel to events and assorted meetups. Everybody is looking for swag.

--

--

Nicolas Grenié
Typeform's Engineering Blog

@typeform Dev Advocate, ex-@3scale, @sfcheeseparty enthusiast — G33k 🤓, fun🤘, frogs🐸 and snails🐌!