Skip to content



The back-end integration is the completly secure solution for implementing the SmartWall into your website. It builds on top of the front-end solution to provide an extra layer of security that makes the wall unavoidable. It works for every back-end language since we provide a RESTful API to comunicate with SmartWall.

It requires that your first implement the front-end integration. When you're done and sure it's working, come back and continue the back-end integration.

How does it work ?

The principal issue with the front-end integration is that if the user blocks scripts before they run, there is no way to hide or lock the article's content. How to avoid this issue ? Simple, don't send the full article content with your page. Instead you'll send the article content to SmartWall's cache and it will take care of sending the full article when the user unlocks the wall.

Upgrade from front-end integration

If you started the integration of SmartWall with the front-end method, you can keep the configuration of the JavaScript SDK and add a new parameter called mode, which value should be backend.

new SmartWallSDK({
  smartwallUid: "your-smartwall-uid",
  apiKey: "your-api-key",
  mode: 'backend'


The SmartWall's API will provide you with the endpoints needed for this integration.

Its domain is From now on will assume this domain for all endpoints described.

Caching your article

First thing is to cache your article in SmartWall's API. This will allow SmartWall to send the article content only and just only the user unlocks the wall some way or another, subscribing, micropayment, watching an ad, etc.

Caching the article will be done within your article's page back-end code.

Check if article is already cached

Sending the whole article to the API and waiting for the response can take a significant time from your article requests. To avoid this problem, you should send the article only if necessesary, so only when it's missing from SmartWall's cache. This endpoint will check if the article is in SmartWall's cache or not.


GET /v2/articles/{articleUid}/is-cached

URL search params:

  • md5 - md5 hash of the article content. If hash changed from last time the article was sent, then it will invalidate cache. This allows to update cache if article is updated.
  • apiKey - Key to access the API.


200 HTTP code

  status: Boolean

Send article to cache

This endpoint will write the article content into SmartWall's cache.


POST /v2/articles/


  • apiKey - Key to access the API.

  • smartwallUid - UID of the SmartWall configured for your site.

  • articleUid - UID you create for this article.

  • content - Article's HTML content.

  • url - Article's URL


204 HTTP code


Truncating your article

Once you're sure the article is in SmartWall's cache, you need to truncate the article before rendering it and sending it to the user. The lenght of the article's preview you want to show is up to you.

How to truncate the article depends on your programming language, but there are many ways to accomplish it and if you need it, an internet search can get you some answers.

Showing the wall

Right after your truncated article you may want to show the SmartWall for the user to unlock the article. If the front-end integration was done correctly the wall will appear once the SDK is loaded (which should take normally a few milliseconds). So nothing else to do.

However, if you find that the Smartwall takes a lot of time to kick off you may want to show a placeholder wall.

Placeholder wall

To add a placeholder wall to show until SmartWall is loaded, add the next code where you want to show the wall and change "your-wall-uid" to yours. You can customize the content and styling.

<div data-sw-wall="your-wall-uid">
  <!-- You can change the content to your liking -->
  <div style="text-align: center; font-size: 1.2rem; font-weight: 400; margin-top: 1.8rem">
    <p style=" margin-bottom: 1.8rem">Your article is taking more than usual to load.</p>
    <p style=" margin-bottom: 1.8rem">Hang in there...</p>

When the SmartWall is loaded it will overwrite this element and show your SmartWall instead.


Frenquently asked questions

What if I have a HTTP cache system on my site?

Back-end integrations works fine with your HTTP cache. You article page needs to run the backend code at least once before being stored rendered in the HTTP cache, so if you did the integration right, the article content will be send to SmartWall's API in that one rendering of the page. The HTTP cache will store the truncated article and SmartWall's cache the full article.

If SmartWall is not returning the full article when the wall is unlocked, try purging your HTTP cache. This way your back-end code will run again and refresh the SmartWall's cache.