- 
                Notifications
    You must be signed in to change notification settings 
- Fork 6
Add inbox Attachment docs #295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            12 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      360c2ca
              
                add inbox attachment docs
              
              
                adamgrad ac8638d
              
                add inbox conversation docs
              
              
                adamgrad 7f91514
              
                add inbox messages docs
              
              
                adamgrad b5fffd9
              
                add participans endpoint docs
              
              
                adamgrad 02b9b8a
              
                replace test url with bookingsync url
              
              
                adamgrad 00c525b
              
                apply feedback
              
              
                adamgrad cb53125
              
                Merge branch 'master' into CORE-793-add-inbox-attachments-docs
              
              
                adamgrad 8fe5d78
              
                remove unnecessary meta data from api calls
              
              
                adamgrad cfd8fc8
              
                add missing show action for attachments endpoint
              
              
                adamgrad 8279cdd
              
                Merge branch 'CORE-793-add-inbox-attachments-docs' of https://github.…
              
              
                adamgrad e3ca635
              
                fix typo
              
              
                adamgrad fd67ac2
              
                Merge branch 'master' into CORE-793-add-inbox-attachments-docs
              
              
                adamgrad File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "attachments": [ | ||
| { | ||
| "name": "filename", | ||
| "file": "here goes encoded file" | ||
| } | ||
| ] | ||
| } | 
        
          
          
            24 changes: 24 additions & 0 deletions
          
          24 
        
  api_calls/reference/attachments/inbox_read-inbox_write-scope-response.json
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | 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
          
          24 
        
  api_calls/reference/attachments/inbox_write-scope-response.json
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | 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": { | ||
| } | ||
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "attachments": [ | ||
| { | ||
| "name": "filename", | ||
| "file": "here goes encoded file" | ||
| } | ||
| ] | ||
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | 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" | ||
| } | ||
| ] | ||
| } | 
        
          
          
            31 changes: 31 additions & 0 deletions
          
          31 
        
  api_calls/reference/conversations/inbox_read-inbox_write-scope-response.json
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | 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
          
          31 
        
  api_calls/reference/conversations/inbox_write-scope-response.json
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | 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": { | ||
| } | ||
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "conversations": [ | ||
| { | ||
| "default_channel": "channelname" | ||
| } | ||
| ] | ||
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | 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" | ||
| } | ||
| ] | ||
| } | 
        
          
          
            26 changes: 26 additions & 0 deletions
          
          26 
        
  api_calls/reference/messages/inbox_read-inbox_write-scope-response.json
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | 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
          
          26 
        
  api_calls/reference/messages/inbox_write-scope-response.json
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | 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": { | ||
| } | ||
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "messages": [ | ||
| { | ||
| "origin": "email", | ||
| "visibility": "external", | ||
| "channel": "email" | ||
| } | ||
| ] | ||
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | 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" | ||
| } | ||
| ] | ||
| } | 
        
          
          
            25 changes: 25 additions & 0 deletions
          
          25 
        
  api_calls/reference/participants/inbox_read-inbox_write-scope-response.json
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | 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
          
          25 
        
  api_calls/reference/participants/inbox_write-scope-response.json
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | 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": "2018-12-21T10:42:17Z", | ||
| "updated_at": "2018-12-21T10:42:17Z" | ||
| } | ||
| ], | ||
| "meta": { | ||
| } | ||
| } | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "participants": [ | ||
| { | ||
| "read": "true" | ||
| } | ||
| ] | ||
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | 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) %> | 
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
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