|
3 | 3 |
|
4 | 4 | Technical overview of the Conduit API.
|
5 | 5 |
|
6 |
| -= Overview = |
7 |
| - |
8 |
| -Conduit is an informal mechanism for transferring ad-hoc JSON blobs around on |
9 |
| -the internet. |
10 |
| - |
11 |
| -Theoretically, it provides an API to Phabricator so external scripts (including |
12 |
| -scripts written in other languages) can interface with the applications in the |
13 |
| -Phabricator suite. It technically does this, sort of, but it is unstable and |
14 |
| -incomplete so you should keep your expectations very low if you choose to build |
15 |
| -things on top of it. |
16 |
| - |
17 |
| -NOTE: Hopefully, this should improve over time, but making Conduit more robust |
18 |
| -isn't currently a major project priority because there isn't much demand for it |
19 |
| -outside of internal scripts. If you want to use Conduit to build things on top |
20 |
| -of Phabricator, let us know so we can adjust priorities. |
21 |
| - |
22 |
| -Conduit provides an authenticated HTTP API for Phabricator. It is informal and |
23 |
| -extremely simple: you post a JSON blob and you get a JSON blob back. You can |
24 |
| -access Conduit in PHP with @{class@libphutil:ConduitClient}, or in any language |
25 |
| -by executing `arc call-conduit method` (see `arc help call-conduit` for |
26 |
| -more information). You can see and test available methods at `/conduit/` in |
27 |
| -the web interface. |
28 |
| - |
29 |
| -Arcanist is implemented using Conduit, and @{class:PhabricatorBot} is |
30 |
| -intended as a practical example of how to write a program which interfaces with |
31 |
| -Phabricator over Conduit. |
32 |
| - |
33 |
| -= Class Relationships = |
34 |
| - |
35 |
| -The primary Conduit workflow is exposed at `/api/`, which routes to |
36 |
| -@{class:PhabricatorConduitAPIController}. This controller builds a |
37 |
| -@{class:ConduitAPIRequest} representing authentication information and POST |
38 |
| -parameters, instantiates an appropriate subclass of @{class:ConduitAPIMethod}, |
39 |
| -and passes the request to it. Subclasses of @{class:ConduitAPIMethod} implement |
40 |
| -the actual methods which Conduit exposes. |
41 |
| - |
42 |
| -Conduit calls which fail throw @{class:ConduitException}, which the controller |
43 |
| -handles. |
44 |
| - |
45 |
| -There is a web interface for viewing and testing Conduit called the "Conduit |
46 |
| -Console", implemented by @{class:PhabricatorConduitConsoleController} at |
47 |
| -`/conduit/`. |
48 |
| - |
49 |
| -A log of connections and calls is stored in |
50 |
| -@{class:PhabricatorConduitMethodCallLog}, and can be accessed on the web via |
51 |
| -@{class:PhabricatorConduitLogController} at `/conduit/log/`. |
52 |
| - |
53 |
| -Conduit provides a token-based handshake mechanism used by |
54 |
| -`arc install-certificate` at `/conduit/token/`, implemented by |
55 |
| -@{class:PhabricatorConduitTokenController} which stores generated tokens using |
56 |
| -@{class:PhabricatorConduitCertificateToken}. |
| 6 | +Overview |
| 7 | +======== |
| 8 | + |
| 9 | +Conduit is the HTTP API for Phabricator. It is roughly JSON-RPC: you usually |
| 10 | +pass a JSON blob, and usually get a JSON blob back, although both call and |
| 11 | +result formats are flexible in some cases. |
| 12 | + |
| 13 | +The easiest way to begin exploring Conduit is by visiting {nav Conduit} in the |
| 14 | +web UI. The application provides an API console which you can use to explore |
| 15 | +available methods, make calls, read documentation, and see examples. |
| 16 | + |
| 17 | +The API console has details about how to construct calls and generate API |
| 18 | +tokens for authentication. |
| 19 | + |
| 20 | +The three primary ways to make Conduit calls are: |
| 21 | + |
| 22 | + - `arc call-conduit`: You can use this `arc` command to execute low-level |
| 23 | + Conduit calls. |
| 24 | + - `curl`: You can format a call with basic HTTP parameters and cURL. |
| 25 | + - `ConduitClient`: |
| 26 | + |
| 27 | +There are also clients available in other languages. The Arcanist CLI client |
| 28 | +for Phabricator is implemented over Conduit. |
0 commit comments