Skip to content

Commit ee7f46e

Browse files
committed
merge conflict
2 parents a86d93f + 950ba7b commit ee7f46e

File tree

3 files changed

+180
-15
lines changed

3 files changed

+180
-15
lines changed

index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ Congratulations, you just made your first Fiesta API request ☺.
5454
Next Steps
5555
----------
5656

57+
Developers should start by checking out the Fiesta :doc:`sandbox`,
58+
which allows testing and experimentation in a low-impact environment.
59+
5760
The next step for developers is to learn about how Fiesta handles
5861
:doc:`authentication` for API clients.
5962

@@ -77,6 +80,7 @@ contributing check out the source on `Github
7780
.. toctree::
7881
:hidden:
7982

83+
sandbox
8084
authentication
8185
list-management-api
8286
message-middleware-api

list-management-api.rst

Lines changed: 102 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ group. We'll start with :http:post:`/group`:
5353
{
5454
creator: {
5555
address: EMAIL_ADDRESS,
56-
group_name: STRING (optioal),
56+
group_name: STRING (optional),
5757
display_name: STRING (optional),
5858
welcome_message: WELCOME_MESSAGE (optional)
5959
} (optional),
@@ -73,11 +73,12 @@ group. We'll start with :http:post:`/group`:
7373
(e.g. "[email protected]"). This address must be owned by the
7474
authenticated user.
7575

76-
`group_name` (optional) is the group name that will be used for
77-
the group's creator. If you're creating a list called
78-
"family\@fiesta.cc", `roup_name` should be "family". `Group_name`
79-
may be omitted if and only if a `default_group_name` is specified
80-
in which case the `default_group_name` will be used.
76+
`group_name` (optional) is the group name that will be used for
77+
the group's creator. If you're creating a list called
78+
"family\@fiesta.cc", `group_name` should be "family". `group_name`
79+
may be omitted if and only if a `default_group_name` is specified.
80+
In that case the `default_group_name` will be used. See
81+
:ref:`group-names` for more information.
8182

8283
`display_name` (optional) is the name that will be displayed for
8384
the group's creator throughout the Fiesta UI (e.g. "Mike
@@ -92,9 +93,10 @@ group. We'll start with :http:post:`/group`:
9293
creator instead. If it's ``null`` or ``false`` no welcome message
9394
will be sent.
9495

95-
`default_group_name` (optional) is the default group name members will
96-
get when added to this group unless a different one is specified when
97-
being added.
96+
`default_group_name` (optional) is the default group name members
97+
will get when added to this group unless a different one is
98+
specified when being added. See :ref:`group-names` for more
99+
information.
98100

99101
`domain` (optional) is the domain to use for the list address. The
100102
default is "fiesta.cc". To use a custom domain your client must
@@ -178,16 +180,18 @@ was returned above:
178180
address: EMAIL_ADDRESS,
179181
group_name: STRING (optional),
180182
display_name: STRING (optional),
181-
welcome_message: WELCOME_MESSAGE (optional)
183+
welcome_message: WELCOME_MESSAGE (optional),
184+
send_invite: BOOLEAN (optional)
182185
}
183186
184187
`address` is the email address of the new member.
185188

186-
`group_name` (optional) is the group name that will be used for the
187-
new member. If you're creating a list called "family\@fiesta.cc",
188-
`group_name` should be "family". `Group_name` may be omitted if
189-
and only if a `default_group_name` exists for the list in which
190-
case the `default_group_name` will be used.
189+
`group_name` (optional) is the group name that will be used for
190+
the new member. If you're creating a list called
191+
"family\@fiesta.cc", `group_name` should be "family". `group_name`
192+
may be omitted if and only if a `default_group_name` exists for
193+
the list. In that case the `default_group_name` will be used. See
194+
:ref:`group-names` for more information.
191195

192196
`display_name` (optional) is the name that will be displayed for
193197
the new member throughout the Fiesta UI. If it's included and the
@@ -201,6 +205,14 @@ was returned above:
201205
instead. If it's ``null`` or ``false`` no welcome message will be
202206
sent.
203207

208+
If `send_invite` is ``True`` (the default is ``False``), the new
209+
member will be invited to the list but not added. They'll receive
210+
an email invitation with a link they can click to join the
211+
list. If `send_invite` is ``True`` and a custom `welcome_message`
212+
is specified, the welcome message must contain the string
213+
``"$invite_url"``, which will be replaced with the URL the user
214+
can click to join the group.
215+
204216
Returns the following JSON data in the response body:
205217

206218
.. code-block:: js
@@ -244,6 +256,28 @@ was returned above:
244256

245257
`group_name` is the name of the group as used by this user.
246258

259+
.. _group-names:
260+
261+
Notes on Group Names
262+
--------------------
263+
264+
Group names may only contain letters, numbers, '-', '_', and '.'. The
265+
maximum length of a group name is 30 characters. Names are not case
266+
sensitive and '-', '_', and '.' are ignored for the purposes of
267+
equality testing. So ``"test"``, ``"t_e_s_t"`` and ``"Te.ST"`` are
268+
considered equivalent.
269+
270+
When adding someone to a list with a specific group name, the name
271+
they are actual added with may differ: Fiesta will automatically
272+
ensure that the name is unique among all of their lists. If
273+
[email protected] already has a list called "family" and your client
274+
attempts to add them to another list using the name "family" the new
275+
list will automatically be renamed to "family1" for that user.
276+
277+
The group namespace is shared across all domains. If you are using a
278+
custom domain the same collision response will occur with groups of
279+
the same name using a different domain.
280+
247281
Sending Messages
248282
----------------
249283

@@ -505,3 +539,56 @@ Getting Group/User Information
505539

506540
Responds with a status code 200 if the memberships were
507541
successfully deleted.
542+
543+
Errors
544+
------
545+
546+
Any API error will result in a response with a 40x HTTP status
547+
code. Error responses also contain a JSON body, e.g.:
548+
549+
.. code-block:: js
550+
551+
{
552+
status: {code: 400},
553+
error: "invalid_request",
554+
error_description: "Unsupported Authorization scheme"
555+
}
556+
557+
`status` will always be present, and contains a `code` field whose value will always match the HTTP status code of the response.
558+
559+
`error` will always be present, and is a short token categorizing the error (see below for a list of possible values).
560+
561+
`error_description` will sometimes be present, and is a long-form description of the error that occurred.
562+
563+
List of possible `error` values:
564+
565+
- ``"invalid_request"`` (400): The client sent a request that is
566+
malformed or missing required values.
567+
568+
- ``"invalid_scope"`` (400): The client requested authorization for a
569+
scope that isn't recognized by the API.
570+
571+
- ``"unsupported_grant_type"`` (400): The client is attempting to use
572+
an unsupported OAuth grant type.
573+
574+
- ``"invalid_token"`` (401): The API call was made using an invalid or
575+
expired token.
576+
577+
- ``"invalid_client"`` (401): The API call was made using invalid
578+
client credentials.
579+
580+
- ``"access_denied"`` (401): The client does not have sufficient
581+
permissions to make the attempted request.
582+
583+
- ``"no_such_resource"`` (404): The client is attempting to operate on
584+
a resource (e.g. group, user, etc.) that does not exist.
585+
586+
- ``"unsupported_response_type"`` (406): The client requested a
587+
response type (using the Accept header) that isn't supported by the
588+
API.
589+
590+
.. note:: It's possible (though unlikely) that an attempt to use the
591+
API could result in a 50x response. Any such response is
592+
automatically reported so we can attempt to address the issue, but
593+
following up with any helpful information about the error is
594+
appreciated.

sandbox.rst

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
API Sandbox
2+
===========
3+
4+
We maintain an API "sandbox" at ``sandbox.fiesta.cc``. This allows API
5+
clients to test interacting with Fiesta, without actually sending any
6+
emails or modifying any real groups or user accounts.
7+
8+
Usage
9+
-----
10+
11+
To use the sandbox, just replace all references to ``api.fiesta.cc``
12+
with ``sandbox.fiesta.cc``. Your client will still need to
13+
authenticate, and you'll use the same credentials as you would with
14+
the production API server. All calls should still use HTTPS.
15+
16+
Special Endpoints
17+
-----------------
18+
19+
The sandbox supports several endpoints that aren't present in the
20+
production API:
21+
22+
.. http:get:: /mailbox
23+
24+
Get information about the messages that would have been sent as a
25+
result of your API calls, had this been running out of the sandbox.
26+
27+
Returns a JSON array with keys for each email address that has been
28+
messaged. The values are arrays of messages, each with a ``"text"``
29+
and ``"subject"`` field:
30+
31+
.. code-block:: js
32+
33+
{
34+
mike@corp.fiesta.cc: [
35+
{
36+
text: "Hello world.",
37+
subject: "Saying hello"
38+
},
39+
...
40+
],
41+
...
42+
}
43+
44+
.. http:post:: /reset
45+
46+
Reset any sandbox state changes made by your client.
47+
48+
This will empty your client's "mailbox" and remove any sandbox
49+
groups or users that have been created as a result of your client's
50+
calls.
51+
52+
Response:
53+
54+
.. code-block:: js
55+
56+
{
57+
"reset": true
58+
}
59+
60+
Notes
61+
-----
62+
63+
The sandbox does share some state among clients, so it's possible to
64+
see some changes in behavior based on activities of other clients.
65+
66+
In the sandbox, clients can use any `Fiesta Custom
67+
<https://fiesta.cc/custom>`_ domain that they want. In production,
68+
clients must have permission to use a Fiesta Custom domain: the
69+
client's owner must be an owner of the domain.
70+
71+
Sandbox state should be treated as temporary. We will try to only
72+
erase state after days of inactivity or an explicit call to
73+
:http:post:`/reset`, but we reserve the right to erase any sandbox
74+
state at any time if it makes our lives significantly easier :).

0 commit comments

Comments
 (0)