Eric Hubert
Nov 19, 2020
(2 votes)

What is the REST API and why should I use it?

In this blog post, I like to introduce you to Episerver Campaign's latest Application Programming Interface (API) following the modern architectural style of Representational State Transfer (REST). I will show you its advantages over our traditional HTTP mail/form and SOAP web services as well as give you some tips to quickly get started.

RESTful web services are based on the principles and behavior of the World Wide Web. They enable consumers to access and manipulate textual representations of web resources using a standardized set of stateless operations (HTTP methods). Responses contain status information about the outcome of request processing (e.g. they can confirm state modifications to a resource or indicate non-existing resources or processing errors) which also follow internet standards, see the Internet Engineering Task Force (IETF) RFCs 7230-7235.

Advantages of the REST API

In addition to its simplicity, ease of use and great interoperability which increase the development and integration productivity, the REST API also brings the following advantages:

  • Support of other data formats than XML; we use the more compact JSON by default
  • JSON results in faster parsing, less network bandwidth usage and offers better support of browser clients (e.g. JavaScript)
  • Superior performance, particularly through caching of information that is not altered and not dynamic
  • More scalable (e.g. no use of sessions)
  • Simple and dynamic documentation based on the OpenAPI specification supporting convenient features like "Try it out" (see below)

Therefore, we focus our own development efforts on the REST API. Existing features of our HTTP and SOAP APIs are continuously integrated in our REST API. Newer features like Smart Campaigns are only available in the REST API. You can find a list of all currently available endpoints in our resource documentation.

Tips for working with the Episerver Campaign REST API

To use the REST API, you need an Episerver Campaign client set up for this purpose, and an API user with credentials to authenticate. Once set up, you can test and use the REST API either directly from our resource documentation using the "Try it out" feature or using any HTTP/REST client of your choice like Postman, Insomnia, Paw or the command-line tool CURL.

Each REST API endpoint URL is built according to the following schema:{clientId}/{component}/{path}?{parameters}.

The "clientID" parameter is the ID of your client in which the REST API has been set up and represents the root element of each endpoint. You can find the client ID in Episerver Campaign under Administration > API overview > REST API.

When performing API calls, you receive response status codes for each request. In addition to the response status code, you should always process an existing response body to either retrieve the representation of the resource or additional information about business errors.

Try it out and share your experience

Please feel free to use the REST API and integrate Episerver Campaign's rich functionality into your system or develop your own solution!

You are also welcome to check the Episerver Campaign blog from time to time - there will be more posts about the REST API, new features, and endpoints in the future.

If you like, you can also blog yourself or discuss APIs and integrations with other developers in the Episerver Campaign forum.

Nov 19, 2020


Please login to comment.
Latest blogs
Update on .NET 8 support

With .NET 8 now in release candidate stage I want to share an update about our current thinking about .NET 8 support in Optimizely CMS and Customiz...

Magnus Rahl | Oct 3, 2023

Adding Block Specific JavaScript and CSS to the body and head of the page

A common requirement for CMS implementations includes the ability to embed third party content into a website as if it formed part of the website...

Mark Stott | Oct 3, 2023

Performance optimization – the hardcore series – part 1

Hi again every body. New day – new thing to write about. today we will talk about memory allocation, and effect it has on your website performance....

Quan Mai | Oct 3, 2023 | Syndicated blog

Next level content delivery with Optimizely Graph

Optimizely introduced a new product called Optimizely Graph earlier this year. We were one of the first partners to adopt this new service in a...

Ynze | Oct 2, 2023 | Syndicated blog