|
1 |
| -<!-- TOC depthFrom:1 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 --> |
| 1 | +<!-- TOC depthfrom:1 depthto:6 withlinks:true updateonsave:true orderedlist:false --> |
2 | 2 |
|
3 | 3 | - [Server API](#server-api)
|
4 |
| - - [How it Works?](#how-it-works) |
5 |
| - - [General Considerations](#general-considerations) |
6 |
| - - [Connecting to the Server](#connecting-to-the-server) |
7 |
| - - [gRPC](#grpc) |
8 |
| - - [WebSocket](#websocket) |
9 |
| - - [Long Polling](#long-polling) |
10 |
| - - [Out of Band Large Files](#out-of-band-large-files) |
11 |
| - - [Running Behind a Reverse Proxy](#running-behind-a-reverse-proxy) |
12 |
| - - [Users](#users) |
13 |
| - - [Authentication](#authentication) |
14 |
| - - [Creating an Account](#creating-an-account) |
15 |
| - - [Logging in](#logging-in) |
16 |
| - - [Changing Authentication Parameters](#changing-authentication-parameters) |
17 |
| - - [Resetting a Password, i.e. "Forgot Password"](#resetting-a-password-ie-forgot-password) |
18 |
| - - [Suspending a User](#suspending-a-user) |
19 |
| - - [Credential Validation](#credential-validation) |
20 |
| - - [Access Control](#access-control) |
21 |
| - - [Topics](#topics) |
22 |
| - - [`me` Topic](#me-topic) |
23 |
| - - [`fnd` and Tags: Finding Users and Topics](#fnd-and-tags-finding-users-and-topics) |
24 |
| - - [Query Language](#query-language) |
25 |
| - - [Incremental Updates to Queries](#incremental-updates-to-queries) |
26 |
| - - [Query Rewrite](#query-rewrite) |
27 |
| - - [Possible Use Cases](#possible-use-cases) |
28 |
| - - [Peer to Peer Topics](#peer-to-peer-topics) |
29 |
| - - [Group Topics](#group-topics) |
30 |
| - - [`sys` Topic](#sys-topic) |
31 |
| - - [Using Server-Issued Message IDs](#using-server-issued-message-ids) |
32 |
| - - [User Agent and Presence Notifications](#user-agent-and-presence-notifications) |
33 |
| - - [Trusted, Public, and Private Fields](#trusted-public-and-private-fields) |
34 |
| - - [Trusted](#trusted) |
35 |
| - - [Public](#public) |
36 |
| - - [Private](#private) |
37 |
| - - [Format of Content](#format-of-content) |
38 |
| - - [Out-of-Band Handling of Large Files](#out-of-band-handling-of-large-files) |
39 |
| - - [Uploading](#uploading) |
40 |
| - - [Downloading](#downloading) |
41 |
| - - [Push Notifications](#push-notifications) |
42 |
| - - [Tinode Push Gateway](#tinode-push-gateway) |
43 |
| - - [Google FCM](#google-fcm) |
44 |
| - - [Stdout](#stdout) |
45 |
| - - [Video Calls](#video-calls) |
46 |
| - - [Messages](#messages) |
47 |
| - - [Client to Server Messages](#client-to-server-messages) |
48 |
| - - [`{hi}`](#hi) |
49 |
| - - [`{acc}`](#acc) |
50 |
| - - [`{login}`](#login) |
51 |
| - - [`{sub}`](#sub) |
52 |
| - - [`{leave}`](#leave) |
53 |
| - - [`{pub}`](#pub) |
54 |
| - - [`{get}`](#get) |
55 |
| - - [`{set}`](#set) |
56 |
| - - [`{del}`](#del) |
57 |
| - - [`{note}`](#note) |
58 |
| - - [Server to Client Messages](#server-to-client-messages) |
59 |
| - - [`{data}`](#data) |
60 |
| - - [`{ctrl}`](#ctrl) |
61 |
| - - [`{meta}`](#meta) |
62 |
| - - [`{pres}`](#pres) |
63 |
| - - [`{info}`](#info) |
| 4 | + - [How it Works?](#how-it-works) |
| 5 | + - [General Considerations](#general-considerations) |
| 6 | + - [Connecting to the Server](#connecting-to-the-server) |
| 7 | + - [gRPC](#grpc) |
| 8 | + - [WebSocket](#websocket) |
| 9 | + - [Long Polling](#long-polling) |
| 10 | + - [Out of Band Large Files](#out-of-band-large-files) |
| 11 | + - [Running Behind a Reverse Proxy](#running-behind-a-reverse-proxy) |
| 12 | + - [Users](#users) |
| 13 | + - [Authentication](#authentication) |
| 14 | + - [Creating an Account](#creating-an-account) |
| 15 | + - [Logging in](#logging-in) |
| 16 | + - [Changing Authentication Parameters](#changing-authentication-parameters) |
| 17 | + - [Resetting a Password, i.e. "Forgot Password"](#resetting-a-password-ie-forgot-password) |
| 18 | + - [Suspending a User](#suspending-a-user) |
| 19 | + - [Credential Validation](#credential-validation) |
| 20 | + - [Access Control](#access-control) |
| 21 | + - [Topics](#topics) |
| 22 | + - [me Topic](#me-topic) |
| 23 | + - [fnd and Tags: Finding Users and Topics](#fnd-and-tags-finding-users-and-topics) |
| 24 | + - [Query Language](#query-language) |
| 25 | + - [Incremental Updates to Queries](#incremental-updates-to-queries) |
| 26 | + - [Query Rewrite](#query-rewrite) |
| 27 | + - [Possible Use Cases](#possible-use-cases) |
| 28 | + - [Peer to Peer Topics](#peer-to-peer-topics) |
| 29 | + - [Group Topics](#group-topics) |
| 30 | + - [sys Topic](#sys-topic) |
| 31 | + - [Using Server-Issued Message IDs](#using-server-issued-message-ids) |
| 32 | + - [User Agent and Presence Notifications](#user-agent-and-presence-notifications) |
| 33 | + - [Trusted, Public, and Private Fields](#trusted-public-and-private-fields) |
| 34 | + - [Trusted](#trusted) |
| 35 | + - [Public](#public) |
| 36 | + - [Private](#private) |
| 37 | + - [Format of Content](#format-of-content) |
| 38 | + - [Out-of-Band Handling of Large Files](#out-of-band-handling-of-large-files) |
| 39 | + - [Uploading](#uploading) |
| 40 | + - [Downloading](#downloading) |
| 41 | + - [Push Notifications](#push-notifications) |
| 42 | + - [Tinode Push Gateway](#tinode-push-gateway) |
| 43 | + - [Google FCM](#google-fcm) |
| 44 | + - [Stdout](#stdout) |
| 45 | + - [Video Calls](#video-calls) |
| 46 | + - [Link Previews](#link-previews) |
| 47 | + - [Messages](#messages) |
| 48 | + - [Client to Server Messages](#client-to-server-messages) |
| 49 | + - [{hi}](#hi) |
| 50 | + - [{acc}](#acc) |
| 51 | + - [{login}](#login) |
| 52 | + - [{sub}](#sub) |
| 53 | + - [{leave}](#leave) |
| 54 | + - [{pub}](#pub) |
| 55 | + - [{get}](#get) |
| 56 | + - [{set}](#set) |
| 57 | + - [{del}](#del) |
| 58 | + - [{note}](#note) |
| 59 | + - [Server to Client Messages](#server-to-client-messages) |
| 60 | + - [{data}](#data) |
| 61 | + - [{ctrl}](#ctrl) |
| 62 | + - [{meta}](#meta) |
| 63 | + - [{pres}](#pres) |
| 64 | + - [{info}](#info) |
64 | 65 |
|
65 | 66 | <!-- /TOC -->
|
66 | 67 |
|
@@ -601,6 +602,21 @@ The `stdout` adapter is mostly useful for debugging and logging. It writes push
|
601 | 602 |
|
602 | 603 | [See separate document](call-establishment.md).
|
603 | 604 |
|
| 605 | +## Link Previews |
| 606 | + |
| 607 | +Tinode provides an optional service which helps client applications generate link (URL) previews for inclusion into messages. The enpoint of this service (if enabled) is located at `/v0/urlpreview`. The service takes a single parameter `url`: |
| 608 | + |
| 609 | +``` |
| 610 | +/v0/urlpreview?url=https%3A%2F%2Ftinode.co |
| 611 | +``` |
| 612 | +The first several kilobytes of the document at the given URL is fetched by issuing an HTTP(S) GET request. If the returned document has content-type `text/html`, the HTML is parsed for page title, description, and image URL. The result is formatted as JSON and returned as |
| 613 | + |
| 614 | +```json |
| 615 | +{"title": "Page title", "description": "This is a page description", "image_url": "https://tinode.co/img/logo64x64.png"} |
| 616 | +``` |
| 617 | + |
| 618 | +The link preview service requires authentication. It's exactly the same as authentication for [Out of Band Large Files](#out-of-band-handling-of-large-files). |
| 619 | + |
604 | 620 | ## Messages
|
605 | 621 |
|
606 | 622 | A message is a logically associated set of data. Messages are passed as JSON-formatted UTF-8 text.
|
|
0 commit comments