iFrame
The wall is a page. Put it in a frame, or open it in a web view or a new tab.
<iframe src="https://yetipoll.com/wall?app=yp_test_pk_your_key&user=USER_ID"
title="Surveys" width="100%" height="700"
style="border:0"></iframe>
Parameters
| Parameter | Meaning |
|---|---|
app | Your public key. Required. |
user | Your id for the user. Required. |
sig | Signature of the user id. Required when the app has "Require signed wall links" on. |
lang | Language of the wall, as a two-letter code. Optional: see language. |
embed | 1 hides the wall's own heading, for when your page already has one. |
Language
The wall speaks the language of the person reading it. It decides in this order:
langin the address, if you pass one, for example&lang=es. Use this when your own site knows which language the user chose.- The language you fixed for the app under Design in your dashboard, if you fixed one.
- The language of the user's browser.
- English.
Available: en (English), es (Español), pt (Português), fr (Français), de (Deutsch), it (Italiano), nl (Nederlands), pl (Polski), tr (Türkçe), ru (Русский), id (Bahasa Indonesia), ar (العربية). A longer code such as pt-BR is read as its first two letters, and one we do not have falls through to the next step. Arabic is laid out from right to left.
The texts of the wall are translated. A survey itself is written by whoever runs it, in the language of the people it is looking for.
Fitting the height
The wall posts its height to the parent page whenever it changes. The script handles this for you; with a plain iframe you can do the same:
window.addEventListener("message", function (event) {
if (event.origin !== "https://yetipoll.com") return;
if (event.data && event.data.source === "yetipoll" && event.data.type === "height") {
document.querySelector("iframe").style.height = event.data.height + "px";
}
});
Signing wall links
By default anyone who knows a user id could open that user's wall. Rewards still only reach your own users through your server, but for production we recommend turning on "Require signed wall links" in the app settings. The wall then only opens with a signature your server made:
sig = HMAC-SHA256(user id, your secret key), as lowercase hex.
// PHP
$sig = hash_hmac("sha256", $userId, $secretKey);
// Node.js
const sig = crypto.createHmac("sha256", secretKey).update(userId).digest("hex");
# Python
sig = hmac.new(secret_key.encode(), user_id.encode(), hashlib.sha256).hexdigest()
Or ask the API for a ready-made, signed address: GET /api/v1/wall-url.
Limiting where the wall may be framed
List your sites under "Sites allowed to show your wall" in the app settings and browsers will refuse to frame it anywhere else. Leave the list empty for mobile apps and web views.