diff --git a/README.md b/README.md index 349f345..954fcbd 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,2 @@ -# Website +# introduction -This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator. - -## Installation - -```console -npm install -``` - -## Local Development - -```console -npm start -``` - -This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server. - -## Build - -```console -npm build -``` - -This command generates static content into the `build` directory and can be served using any static contents hosting service. - -## Deployment - -```console -GIT_USER= USE_SSH=true npm deploy -``` - -If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. diff --git a/SUMMARY.md b/SUMMARY.md new file mode 100644 index 0000000..61236cf --- /dev/null +++ b/SUMMARY.md @@ -0,0 +1,26 @@ +# Table of contents + +* [Introduction](README.md) + * [About](introduction/about.md) + * [FAQs](introduction/faqs.md) +* [Getting Started](getting-started/README.md) + * [Setting up chat](getting-started/chat.md) + * [Development](getting-started/development.md) + * [Replying from Mattermost](getting-started/reply-from-mattermost.md) + * [Replying from Slack](getting-started/reply-from-slack.md) + * [Replying via SMS](getting-started/reply-via-sms.md) +* [Webhooks](webhooks/README.md) + * [Webhook events](webhooks/events.md) + * [Subscribing to events](webhooks/subscribing.md) +* [API Reference](api-reference/README.md) + * [API endpoints](api-reference/api-endpoints.md) + * [Getting an API key](api-reference/api-keys.md) + * [Functions (beta)](api-reference/functions.md) +* [Deploying](deploying/README.md) + * [Deploy on AWS](deploying/aws.md) + * [Deploy with Heroku](deploying/heroku.md) + * [Setting up Slack](deploying/slack.md) +* [Chat](chat/README.md) + * [Configuration](chat/configuration.md) +* [Contributing](contributing.md) +* [Support](support.md) diff --git a/api-reference/README.md b/api-reference/README.md new file mode 100644 index 0000000..d91fcaa --- /dev/null +++ b/api-reference/README.md @@ -0,0 +1,2 @@ +# api-reference + diff --git a/docs/api-reference/api-endpoints.md b/api-reference/api-endpoints.md similarity index 88% rename from docs/api-reference/api-endpoints.md rename to api-reference/api-endpoints.md index a1ef832..99565d7 100644 --- a/docs/api-reference/api-endpoints.md +++ b/api-reference/api-endpoints.md @@ -1,26 +1,28 @@ --- id: api-endpoints title: API endpoints -description: 'Public Papercups API endpoints' slug: /api-endpoints +description: Public Papercups API endpoints --- +# API endpoints + The Papercups API is organized around REST. Our API has predictable resource-oriented URLs, accepts both form-encoded and JSON request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. -Before you can use the API, you'll need to [get an API key](api-keys). +Before you can use the API, you'll need to [get an API key](../docs/api-reference/api-keys/). -### Users +#### Users A user represents a person with a Papercups account. For your company's users, see `customers` below. -#### Retrieve your personal information +**Retrieve your personal information** -```bash title="GET /api/v1/me" +```bash curl https://app.papercups.io/api/v1/me \ -H "Authorization: Bearer [YOUR_API_KEY]" ``` -```json title="Response" +```json { "data": { "account_id": "eb504736-xxxx-xxxx-xxxx-1a82ae60b266", @@ -31,11 +33,11 @@ curl https://app.papercups.io/api/v1/me \ } ``` -### Conversations +#### Conversations A conversation represents a thread of messages. -#### The conversation object +**The conversation object** ```json { @@ -57,9 +59,9 @@ A conversation represents a thread of messages. } ``` -#### Create a conversation +**Create a conversation** -```bash title="POST /api/v1/conversations" +```bash curl https://app.papercups.io/api/v1/conversations \ -H "Authorization: Bearer [YOUR_API_KEY]" \ -X POST \ @@ -68,7 +70,7 @@ curl https://app.papercups.io/api/v1/conversations \ -d "conversation[status]"="open" ``` -```json title="Response" +```json { "data": { "id": "05f67a21-xxxx-xxxx-xxxx-71b22039cf49", @@ -86,14 +88,14 @@ curl https://app.papercups.io/api/v1/conversations \ } ``` -#### Retrieve a conversation +**Retrieve a conversation** -```bash title="GET /api/v1/conversations/:id" +```bash curl https://app.papercups.io/api/v1/conversations/[id] \ -H "Authorization: Bearer [YOUR_API_KEY]" ``` -```json title="Response" +```json { "data": { "id": "56d2cfd6-xxxx-xxxx-xxxx-c4770868ee4c", @@ -114,16 +116,16 @@ curl https://app.papercups.io/api/v1/conversations/[id] \ } ``` -#### Update a conversation +**Update a conversation** -```bash title="PUT /api/v1/conversations/:id" +```bash curl https://app.papercups.io/api/v1/conversations/[id] \ -H "Authorization: Bearer [YOUR_API_KEY]" \ -X PUT \ -d "conversation[status]"="closed" ``` -```json title="Response" +```json { "data": { "id": "05f67a21-xxxx-xxxx-xxxx-71b22039cf49", @@ -141,35 +143,35 @@ curl https://app.papercups.io/api/v1/conversations/[id] \ } ``` -#### Delete a conversation +**Delete a conversation** -```bash title="DELETE /api/v1/conversations/:id" +```bash curl https://app.papercups.io/api/v1/conversations/[id] \ -H "Authorization: Bearer [YOUR_API_KEY]" \ -X DELETE ``` -```bash title="Response" +```bash No response ``` -#### List all conversations +**List all conversations** -```bash title="GET /api/v1/conversations" +```bash curl https://app.papercups.io/api/v1/conversations \ -H "Authorization: Bearer [YOUR_API_KEY]" ``` We also support filtering by `status`, `priority`, `customer_id`, and `assignee_id`: -```bash title="GET /api/v1/conversations?status=closed" +```bash curl https://app.papercups.io/api/v1/conversations \ -H "Authorization: Bearer [YOUR_API_KEY]" \ -G \ -d status="closed" ``` -```json title="Response" +```json { "data": [ { @@ -198,11 +200,11 @@ curl https://app.papercups.io/api/v1/conversations \ } ``` -### Customers +#### Customers A customer represents one of your business's users, leads, or contacts. -#### The customer object +**The customer object** ```json { @@ -236,9 +238,9 @@ A customer represents one of your business's users, leads, or contacts. } ``` -#### Create a customer +**Create a customer** -```bash title="POST /api/v1/customers" +```bash curl https://app.papercups.io/api/v1/customers \ -H "Authorization: Bearer [YOUR_API_KEY]" \ -X POST \ @@ -248,7 +250,7 @@ curl https://app.papercups.io/api/v1/customers \ -d "customer[account_id]"=[account_id] ``` -```json title="Response" +```json { "data": { "id": "0e52c2c9-xxxx-xxxx-xxxx-9094418f22fd", @@ -277,14 +279,14 @@ curl https://app.papercups.io/api/v1/customers \ } ``` -#### Retrieve a customer +**Retrieve a customer** -```bash title="GET /api/v1/customers/:id" +```bash curl https://app.papercups.io/api/v1/customers/[id] \ -H "Authorization: Bearer [YOUR_API_KEY]" ``` -```json title="Response" +```json { "data": { "id": "b4b6eaa9-xxxx-xxxx-xxxx-7c8b6fd36974", @@ -318,16 +320,16 @@ curl https://app.papercups.io/api/v1/customers/[id] \ } ``` -#### Update a customer +**Update a customer** -```bash title="PUT /api/v1/customers/:id" +```bash curl https://app.papercups.io/api/v1/customers/[id] \ -H "Authorization: Bearer [YOUR_API_KEY]" \ -X PUT \ -d "customer[phone]"="650-555-6789" ``` -```json title="Response" +```json { "data": { "id": "0e52c2c9-xxxx-xxxx-xxxx-9094418f22fd", @@ -356,35 +358,35 @@ curl https://app.papercups.io/api/v1/customers/[id] \ } ``` -#### Delete a customer +**Delete a customer** -```bash title="DELETE /api/v1/customers/:id" +```bash curl https://app.papercups.io/api/v1/customers/[id] \ -H "Authorization: Bearer [YOUR_API_KEY]" \ -X DELETE ``` -```bash title="Response" +```bash No response ``` -#### List all customers +**List all customers** -```bash title="GET /api/v1/customers" +```bash curl https://app.papercups.io/api/v1/customers \ -H "Authorization: Bearer [YOUR_API_KEY]" ``` We also support filtering by `name`, `email`, `host`, and `company_id`: -```bash title="GET /api/v1/customers?name=Alex" +```bash curl https://app.papercups.io/api/v1/customers \ -H "Authorization: Bearer [YOUR_API_KEY]" \ -G \ -d name="Alex" ``` -```json title="Response" +```json { "data": [ { @@ -421,11 +423,11 @@ curl https://app.papercups.io/api/v1/customers \ } ``` -### Messages +#### Messages Represents messages sent from the chat widget, the dashboard, Slack, etc. -#### The message object +**The message object** ```json { @@ -464,9 +466,9 @@ Represents messages sent from the chat widget, the dashboard, Slack, etc. } ``` -#### Create a message +**Create a message** -```bash title="POST /api/v1/messages" +```bash curl https://app.papercups.io/api/v1/messages \ -H "Authorization: Bearer [YOUR_API_KEY]" \ -X POST \ @@ -474,7 +476,7 @@ curl https://app.papercups.io/api/v1/messages \ -d "message[conversation_id]"="56d2cfd6-c8a6-410b-93f5-c4770868ee4c" ``` -```json title="Response" +```json { "data": { "id": "62dfee85-xxxx-xxxx-xxxx-5d0759f6495b", @@ -505,14 +507,14 @@ curl https://app.papercups.io/api/v1/messages \ } ``` -#### Retrieve a message +**Retrieve a message** -```bash title="GET /api/v1/messages/:id" +```bash curl https://app.papercups.io/api/v1/messages/[id] \ -H "Authorization: Bearer [YOUR_API_KEY]" ``` -```json title="Response" +```json { "data": { "id": "2a1239b8-xxxx-xxxx-xxxx-16267296abcf", @@ -551,26 +553,26 @@ curl https://app.papercups.io/api/v1/messages/[id] \ } ``` -#### Delete a message +**Delete a message** -```bash title="DELETE /api/v1/messages/:id" +```bash curl https://app.papercups.io/api/v1/messages/[id] \ -H "Authorization: Bearer [YOUR_API_KEY]" \ -X DELETE ``` -```bash title="Response" +```bash No response ``` -#### List all messages +**List all messages** -```bash title="GET /api/v1/messages" +```bash curl https://app.papercups.io/api/v1/messages \ -H "Authorization: Bearer [YOUR_API_KEY]" ``` -```json title="Response" +```json { "data": [ { diff --git a/docs/api-reference/api-keys.md b/api-reference/api-keys.md similarity index 100% rename from docs/api-reference/api-keys.md rename to api-reference/api-keys.md diff --git a/docs/api-reference/functions.md b/api-reference/functions.md similarity index 100% rename from docs/api-reference/functions.md rename to api-reference/functions.md diff --git a/blog/2019-05-28-hola.md b/blog/2019-05-28-hola.md deleted file mode 100644 index 4adbc32..0000000 --- a/blog/2019-05-28-hola.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -slug: hola -title: Hola -author: Gao Wei -author_title: Docusaurus Core Team -author_url: https://github.com/wgao19 -author_image_url: https://avatars1.githubusercontent.com/u/2055384?v=4 -tags: [hola, docusaurus] ---- - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet diff --git a/blog/2019-05-29-hello-world.md b/blog/2019-05-29-hello-world.md deleted file mode 100644 index 151671f..0000000 --- a/blog/2019-05-29-hello-world.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -slug: hello-world -title: Hello -author: Endilie Yacop Sucipto -author_title: Maintainer of Docusaurus -author_url: https://github.com/endiliey -author_image_url: https://avatars1.githubusercontent.com/u/17883920?s=460&v=4 -tags: [hello, docusaurus] ---- - -Welcome to this blog. This blog is created with [**Docusaurus 2 alpha**](https://v2.docusaurus.io/). - - - -This is a test post. - -A whole bunch of other information. diff --git a/blog/2019-05-30-welcome.md b/blog/2019-05-30-welcome.md deleted file mode 100644 index d35d57b..0000000 --- a/blog/2019-05-30-welcome.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -slug: welcome -title: Welcome -author: Yangshun Tay -author_title: Front End Engineer @ Facebook -author_url: https://github.com/yangshun -author_image_url: https://avatars0.githubusercontent.com/u/1315101?s=400&v=4 -tags: [facebook, hello, docusaurus] ---- - -Blog features are powered by the blog plugin. Simply add files to the `blog` directory. It supports tags as well! - -Delete the whole directory if you don't want the blog features. As simple as that! diff --git a/chat/README.md b/chat/README.md new file mode 100644 index 0000000..e76b9ae --- /dev/null +++ b/chat/README.md @@ -0,0 +1,2 @@ +# chat + diff --git a/docs/chat/configuration.md b/chat/configuration.md similarity index 100% rename from docs/chat/configuration.md rename to chat/configuration.md diff --git a/docs/contributing.md b/contributing.md similarity index 100% rename from docs/contributing.md rename to contributing.md diff --git a/deploying/README.md b/deploying/README.md new file mode 100644 index 0000000..cbebb50 --- /dev/null +++ b/deploying/README.md @@ -0,0 +1,2 @@ +# deploying + diff --git a/docs/deploying/aws.md b/deploying/aws.md similarity index 100% rename from docs/deploying/aws.md rename to deploying/aws.md diff --git a/docs/deploying/heroku.md b/deploying/heroku.md similarity index 100% rename from docs/deploying/heroku.md rename to deploying/heroku.md diff --git a/docs/deploying/slack.md b/deploying/slack.md similarity index 100% rename from docs/deploying/slack.md rename to deploying/slack.md diff --git a/getting-started/README.md b/getting-started/README.md new file mode 100644 index 0000000..c375f56 --- /dev/null +++ b/getting-started/README.md @@ -0,0 +1,2 @@ +# getting-started + diff --git a/docs/getting-started/chat.md b/getting-started/chat.md similarity index 100% rename from docs/getting-started/chat.md rename to getting-started/chat.md diff --git a/docs/getting-started/development.md b/getting-started/development.md similarity index 100% rename from docs/getting-started/development.md rename to getting-started/development.md diff --git a/docs/getting-started/reply-from-mattermost.md b/getting-started/reply-from-mattermost.md similarity index 100% rename from docs/getting-started/reply-from-mattermost.md rename to getting-started/reply-from-mattermost.md diff --git a/docs/getting-started/reply-from-slack.md b/getting-started/reply-from-slack.md similarity index 100% rename from docs/getting-started/reply-from-slack.md rename to getting-started/reply-from-slack.md diff --git a/docs/getting-started/reply-via-sms.md b/getting-started/reply-via-sms.md similarity index 100% rename from docs/getting-started/reply-via-sms.md rename to getting-started/reply-via-sms.md diff --git a/docs/introduction/about.md b/introduction/about.md similarity index 100% rename from docs/introduction/about.md rename to introduction/about.md diff --git a/docs/introduction/faqs.md b/introduction/faqs.md similarity index 50% rename from docs/introduction/faqs.md rename to introduction/faqs.md index 50395fd..df99069 100644 --- a/docs/introduction/faqs.md +++ b/introduction/faqs.md @@ -1,35 +1,37 @@ --- id: faqs title: FAQs -description: 'Frequently Asked Questions' slug: /faqs +description: Frequently Asked Questions --- -### What's your pricing? +# FAQs + +#### What's your pricing? You can find our pricing information at https://papercups.io/pricing. We're currently offering deals for startups, so don't hesitate to reach out! -### Is there a hosted version? +#### Is there a hosted version? Yes! We offer both a hosted version, as well as a self-hosted version that you can deploy on your own. Sign up for a free trial of our hosted version here: https://app.papercups.io/register -### How do I self-host Papercups? +#### How do I self-host Papercups? -The easiest way at the moment is by deploying with [Heroku](heroku). +The easiest way at the moment is by deploying with [Heroku](../docs/introduction/heroku/). -### Does your chat component work with X? +#### Does your chat component work with X? We currently support the following: -- HTML `