Quick start
Ask for a link, open it, and if you like, show it inside your page.
- You need
- the Anping address
- a secret key for your app (API key)
- the name of a computer setup (model id)
- from whoever runs the Anping server (deploying)
A model is one computer set up in Anping, with its settings (models).
1Ask for a link
Send it from your server, never from the browser. Sending it as a form (POST) keeps the key out of web addresses and logs.
curl -X POST https://anping.example.com/ws/oturl/get \
--data-urlencode "apikey=$ANPING_API_KEY" \
--data-urlencode "apiuser=alice@example.com" \
--data-urlencode "model=sales-desktop"Anping answers with the end of the link, as plain text:
/oturl.html?key=<43 characters>&pass=<8 characters>Moving from Thinfinity? Your current request (GET) keeps working (when to switch to POST).
2Open it
https://anping.example.com/oturl.html?key=...&pass=...| When | What happens |
|---|---|
| It opens | The page first removes the secret parts (key and pass) from the address bar, then connects. |
| Unused | Stops working after expires minutes (10 by default). |
| Reload, reconnect | Only the browser that opened it: up to 10 minutes after the last disconnect, at most 12 hours after the first open. |
| Another browser | This link has already been used or has expired. |
| No user name or password in the model | The page asks the user. |
Opening it from your page with window.open? Open the new tab right when the user clicks, or the browser's popup blocker may stop it (how).
3Embed it (optional)
First allow your site's address (its origin) in Oturl:FrameAncestors on the Anping server, such as Oturl__FrameAncestors__0=https://app.example.com. Then:
<iframe src="https://anping.example.com/oturl.html?key=...&pass=..."
title="Remote desktop"
allow="fullscreen; clipboard-read; clipboard-write; autoplay"
referrerpolicy="no-referrer"
style="width: 100%; height: 80vh; border: 0"></iframe>Reloads, sound and messages to your page: Embedding.
Change what the link opens
Add more options (OTURL parameters) to the request. When you name a model, they only count with overrideDefaults=true. Every option: API reference; ready-made code: Samples.
Example: fixed size, no clipboard
curl -X POST https://anping.example.com/ws/oturl/get \
--data-urlencode "apikey=$ANPING_API_KEY" \
--data-urlencode "apiuser=alice@example.com" \
--data-urlencode "model=sales-desktop" \
--data-urlencode "overrideDefaults=true" \
--data-urlencode "resolution=fixed" \
--data-urlencode "width=1280" \
--data-urlencode "height=800" \
--data-urlencode "clipboard=false"