Skip to content
Merged
8 changes: 8 additions & 0 deletions api_calls/reference/attachments/create-request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"attachments": [
{
"name": "filename",
"file": "here goes encoded file"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"links": {
"attachments.account": "https://www.bookingsync.com/api/v3/accounts/{attachments.account}",
"attachments.messages": "https://www.bookingsync.com/api/v3/inbox/messages/{attachments.messages}"
},
"attachments": [
{
"links": {
"account": 1, "messages": []
},
"created_at": "2018-12-19T12:58:53Z",
"file_content_type": "text/plain",
"file_size": 1400,
"id": 1,
"image_height": 480,
"image_width": 120,
"name": "example.jpg",
"updated_at": "2018-12-19T12:58:53Z",
"url": "/path/to/image/example"
}
],
"meta": {
}
}
24 changes: 24 additions & 0 deletions api_calls/reference/attachments/inbox_write-scope-response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"links": {
"attachments.account": "https://www.bookingsync.com/api/v3/accounts/{attachments.account}",
"attachments.messages": "https://www.bookingsync.com/api/v3/inbox/messages/{attachments.messages}"
},
"attachments": [
{
"links": {
"account": 1, "messages": []
},
"created_at": "2018-12-19T12:58:53Z",
"file_content_type": "text/plain",
"file_size": 1000,
"id": 1,
"image_height": null,
"image_width": null,
"name": "filename",
"updated_at": "2018-12-19T12:58:53Z",
"url": "url/to/the/file"
}
],
"meta": {
}
}
8 changes: 8 additions & 0 deletions api_calls/reference/attachments/update-request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"attachments": [
{
"name": "filename",
"file": "here goes encoded file"
}
]
}
9 changes: 9 additions & 0 deletions api_calls/reference/conversations/create-request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"conversations": [
{
"subject": "Subject.",
"default_channel": "channelname",
"last_message_at": "2018-12-20T14:25:57Z"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"links": {
"conversations.account": "https://www.bookingsync.com/api/v3/accounts/{conversations.account}",
"conversations.assignee": "https://www.bookingsync.com/api/v3/hosts/{conversations.assignee}",
"conversations.source": "https://www.bookingsync.com/api/v3/sources/{conversations.source}",
"conversations.bookings": "https://www.bookingsync.com/api/v3/bookings/{conversations.bookings}",
"conversations.inquiries": "https://www.bookingsync.com/api/v3/inquiries/{conversations.inquiries}"
},
"conversations": [
{
"links": {
"account": 1,
"assignee": null,
"bookings": [],
"inquiries": [],
"source": null
},
"closed_at": null,
"created_at": "2018-12-20T14:25:57Z",
"deadline_response_at": null,
"default_channel": null,
"id": 5,
"last_message_at": "2018-11-22T12:19:57Z",
"marked_as_spam_at": null,
"subject": "Here goes subject of conversation.",
"updated_at": "2018-12-20T14:25:57Z"
}
],
"meta": {
}
}
31 changes: 31 additions & 0 deletions api_calls/reference/conversations/inbox_write-scope-response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"links": {
"conversations.account": "https://www.bookingsync.com/api/v3/accounts/{conversations.account}",
"conversations.assignee": "https://www.bookingsync.com/api/v3/hosts/{conversations.assignee}",
"conversations.source": "https://www.bookingsync.com/api/v3/sources/{conversations.source}",
"conversations.bookings": "https://www.bookingsync.com/api/v3/bookings/{conversations.bookings}",
"conversations.inquiries": "https://www.bookingsync.com/api/v3/inquiries/{conversations.inquiries}"
},
"conversations": [
{
"links": {
"account": 1,
"assignee": null,
"bookings": [],
"inquiries": [],
"source": null
},
"closed_at": null,
"created_at": "2018-12-20T14:25:57Z",
"deadline_response_at": null,
"default_channel": "channelname",
"id": 5,
"last_message_at": "2018-12-20T14:25:57Z",
"marked_as_spam_at": null,
"subject": "Subject.",
"updated_at": "2018-12-20T14:25:57Z"
}
],
"meta": {
}
}
7 changes: 7 additions & 0 deletions api_calls/reference/conversations/update-request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"conversations": [
{
"default_channel": "channelname"
}
]
}
13 changes: 13 additions & 0 deletions api_calls/reference/messages/create-request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"messages": [
{
"content": "Message Content",
"origin": "email",
"visibility": "external",
"conversation_id": 7,
"sender_id": 5,
"channel": "email",
"sent_at": "2018-12-21T09:21:52Z"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"links": {
"messages.attachments": "https://www.bookingsync.com/api/v3/inbox/attachments/{messages.attachments}",
"messages.conversation": "https://www.bookingsync.com/api/v3/inbox/conversations/{messages.conversation}",
"messages.sender": "https://www.bookingsync.com/api/v3/inbox/participants/{messages.sender}"
},
"messages": [
{
"links": {
"attachments": [],
"conversation": 7,
"sender": 5
},
"channel": null,
"content": "Some content.",
"created_at": "2018-12-21T09:21:52Z",
"id": 5,
"origin": "email",
"sent_at": null,
"updated_at": "2018-12-21T09:21:52Z",
"visibility": "external"
}
],
"meta": {
}
}
26 changes: 26 additions & 0 deletions api_calls/reference/messages/inbox_write-scope-response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"links": {
"messages.attachments": "https://www.bookingsync.com/api/v3/inbox/attachments/{messages.attachments}",
"messages.conversation": "https://www.bookingsync.com/api/v3/inbox/conversations/{messages.conversation}",
"messages.sender": "https://www.bookingsync.com/api/v3/inbox/participants/{messages.sender}"
},
"messages": [
{
"links": {
"attachments": [],
"conversation": 7,
"sender": 5
},
"channel": "email",
"content": "Message Content",
"created_at": "2018-12-21T09:21:52Z",
"id": 5,
"origin": "email",
"sent_at": "2018-12-21T09:21:52Z",
"updated_at": "2018-12-21T09:21:52Z",
"visibility": "external"
}
],
"meta": {
}
}
9 changes: 9 additions & 0 deletions api_calls/reference/messages/update-request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"messages": [
{
"origin": "email",
"visibility": "external",
"channel": "email"
}
]
}
11 changes: 11 additions & 0 deletions api_calls/reference/participants/create-request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"participants": [
{
"last_message_sent_at": "2018-12-15T10:42:17Z",
"member_id": 5,
"member_type": "Host",
"conversation_id": 3,
"read": "true"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"links": {
"participants.conversation": "https://www.bookingsync.com/api/v3/inbox/conversations/{participants.conversation}",
"participants.client": "https://www.bookingsync.com/api/v3/clients/{participants.member.id}",
"participants.host": "https://www.bookingsync.com/api/v3/hosts/{participants.member.id}"
},
"participants": [
{
"links": {
"conversation": 3,
"member": {
"id": 5,
"type": "Host"
}
},
"created_at": "2018-12-21T10:42:17Z",
"id": 10,
"last_message_sent_at": "2018-12-15T10:42:17Z",
"read_at": null,
"updated_at": "2018-12-21T10:42:17Z"
}
],
"meta": {
}
}
25 changes: 25 additions & 0 deletions api_calls/reference/participants/inbox_write-scope-response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"links": {
"participants.conversation": "https://www.bookingsync.com/api/v3/inbox/conversations/{participants.conversation}",
"participants.client": "https://www.bookingsync.com/api/v3/clients/{participants.member.id}",
"participants.host": "https://www.bookingsync.com/api/v3/hosts/{participants.member.id}"
},
"participants": [
{
"links": {
"conversation": 3,
"member": {
"id": 5,
"type": "Host"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, in that case we need docs for /hosts endpoint but that could be a separate PR

}
},
"created_at": "2018-12-21T10:42:17Z",
"id": 10,
"last_message_sent_at": "2018-12-15T10:42:17Z",
"read_at": "2018-12-21T10:42:17Z",
"updated_at": "2018-12-21T10:42:17Z"
}
],
"meta": {
}
}
7 changes: 7 additions & 0 deletions api_calls/reference/participants/update-request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"participants": [
{
"read": "true"
}
]
}
89 changes: 89 additions & 0 deletions content/reference/endpoints/inbox_attachments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Inbox Attachments

1. TOC
{:toc}

### Parameters
<ul class="nav nav-pills" role="tablist">
<li class="disabled"><a>OAuth Scopes:</a></li>
<li class="active"><a href="#inbox_read" role="tab" data-toggle="pill">inbox_read</a></li>
<li><a href="#inbox_write" role="tab" data-toggle="pill">inbox_write</a></li>
</ul>
<div class="tab-content" markdown="1">
<div class="tab-pane active" id="inbox_read" markdown="1">
Name | Type | Read/Write | Description
------------------|---------|------------|------------
id | Integer | Read | Attachment's id.
account_id | Integer | Read | Id of Account Attachment belongs to.
------------------|---------|------------|------------
url | String | Read | Attachment's url address.
name | String | Read | Attachment's name.
image_width | Integer | Read | Attachment's image width in pixels.
image_height | Integer | Read | Attachment's image height in pixels.
file_size | Integer | Read | Attachment's file size in bytes.
file_content_type | String | Read | Attachment's file content type.
------------------|---------|------------|------------
created_at | [Time](/reference/enums#formats) | Read | Attachment's create time.
updated_at | [Time](/reference/enums#formats) | Read | Attachment's update time.
{: class="table table-bordered"}
</div>
<div class="tab-pane" id="inbox_write" markdown="1">
Name | Type | Read/Write | Description
------------------|---------|------------|------------
id | Integer | Read | Attachment's id.
account_id | Integer | Read | Id of Account Attachment belongs to.
------------------|---------|------------|------------
remote_file_url | String | Write | Attachment's remote url address.
file | String | Write | Attachment's Base64 encoded file.
url | String | Read | Attachment's url address.
name | String | Read/Write | Attachment's name.
image_width | Integer | Read | Attachment's image width in pixels.
image_height | Integer | Read | Attachment's image height in pixels.
file_size | Integer | Read | Attachment's file size in bytes.
file_content_type | String | Read | Attachment's file content type.
------------------|---------|------------|------------
created_at | [Time](/reference/enums#formats) | Read | Attachment's create time.
updated_at | [Time](/reference/enums#formats) | Read | Attachment's update time.
{: class="table table-bordered"}
</div>
</div>

## List Attachments

~~~
GET /inbox/attachments
~~~

<%= render 'json_response', endpoint: "attachments", scopes: %w(inbox_read-inbox_write) %>

## Get a single Attachment

Returns a single attachment identified by ID.

~~~
GET /inbox/attachments/:attachment_id
~~~

<%= render 'json_response', endpoint: "attachments", scopes: %w(inbox_read-inbox_write) %>

## Create a new attachment

Creates an attachment.

~~~~
POST /inbox/attachments
~~~~

<%= render 'json_response', endpoint: "attachments", request: "create",
scopes: %w(inbox_write) %>

## Update an attachment

Returns an updated attachment identified by ID.

~~~
PUT /inbox/attachments/:id
~~~

<%= render 'json_response', endpoint: "attachments", request: "update",
scopes: %w(inbox_write) %>
Loading