Skip to content

Instantly share code, notes, and snippets.

@hoffmabc
Last active May 22, 2016 07:28
Show Gist options
  • Select an option

  • Save hoffmabc/38883a3fb08f26b80330 to your computer and use it in GitHub Desktop.

Select an option

Save hoffmabc/38883a3fb08f26b80330 to your computer and use it in GitHub Desktop.

Revisions

  1. hoffmabc revised this gist Jul 8, 2015. 1 changed file with 65 additions and 5 deletions.
    70 changes: 65 additions & 5 deletions gistfile1.yml
    Original file line number Diff line number Diff line change
    @@ -116,11 +116,16 @@ paths:
    description: GUID for the user on the network.
    required: true
    type: string
    - name: limit
    - name: count
    in: query
    description: Number of listings to limit request to before stopping
    required: false
    type: number
    - name: offset
    in: query
    description: Offset number to start at
    required: false
    type: number
    tags:
    - Users
    - Listings
    @@ -141,11 +146,16 @@ paths:
    description: |
    The *cases* endpoint allows retrieval of current moderator cases.
    parameters:
    - name: limit
    - name: count
    in: query
    description: Number of cases to limit request to before stopping
    required: false
    type: number
    - name: offset
    in: query
    description: Offset number to start at
    required: false
    type: number
    tags:
    - Cases
    responses:
    @@ -233,11 +243,16 @@ paths:
    description: |
    The *sales* endpoint allows retrieval of current sales orders.
    parameters:
    - name: limit
    - name: count
    in: query
    description: Number of orders to limit request to before stopping
    required: false
    type: number
    - name: offset
    in: query
    description: Offset number to start at
    required: false
    type: number
    - name: filter
    in: query
    description: Filter for narrowing down list of orders to return.
    @@ -309,11 +324,16 @@ paths:
    description: |
    The *purchases* endpoint allows retrieval of current purchases.
    parameters:
    - name: limit
    - name: count
    in: query
    description: Number of orders to limit request to before stopping
    required: false
    type: number
    - name: offset
    in: query
    description: Offset number to start at
    required: false
    type: number
    - name: filter
    in: query
    description: Filter for narrowing down list of orders to return.
    @@ -426,6 +446,11 @@ paths:
    description: Limits messages returned to this amount
    required: false
    type: number
    - name: offset
    in: query
    description: Offset number to start from
    required: false
    type: number
    - name: show_cleared
    in: query
    description: Include messages that were previously cleared
    @@ -524,6 +549,11 @@ paths:
    description: Search term to look for on the network
    required: true
    type: string
    - name: count
    in: query
    description: Number of items to return
    required: false
    type: number
    tags:
    - Search
    responses:
    @@ -548,6 +578,11 @@ paths:
    description: Search term to look for on the network
    required: true
    type: string
    - name: count
    in: query
    description: Number of items to return
    required: false
    type: number
    tags:
    - Search
    responses:
    @@ -572,6 +607,11 @@ paths:
    description: Search term to look for on the network
    required: true
    type: string
    - name: count
    in: query
    description: Number of items to return
    required: false
    type: number
    tags:
    - Search
    responses:
    @@ -596,6 +636,11 @@ paths:
    description: Search term to look for on the network
    required: true
    type: string
    - name: count
    in: query
    description: Number of items to return
    required: false
    type: number
    tags:
    - Search
    responses:
    @@ -620,6 +665,11 @@ paths:
    description: Search term to look for on the network
    required: true
    type: string
    - name: count
    in: query
    description: Number of items to return
    required: false
    type: number
    tags:
    - Search
    responses:
    @@ -644,6 +694,16 @@ paths:
    description: Search term to filter the results
    required: false
    type: string
    - name: count
    in: query
    description: Number of items to return
    required: false
    type: number
    - name: offset
    in: query
    description: Offset number where to start querying from
    required: false
    type: number
    tags:
    - Listings
    - Users
    @@ -791,7 +851,7 @@ definitions:
    description: GUID of the recipient
    timestamp:
    type: string
    description: Timestamp when message was sent
    description: Date Timestamp when message was sent
    Error:
    properties:
    code:
  2. hoffmabc revised this gist Jul 8, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.yml
    Original file line number Diff line number Diff line change
    @@ -790,8 +790,8 @@ definitions:
    type: string
    description: GUID of the recipient
    timestamp:
    type: datetime
    description: Date Timestamp when message was sent
    type: string
    description: Timestamp when message was sent
    Error:
    properties:
    code:
  3. hoffmabc revised this gist Jul 8, 2015. 1 changed file with 22 additions and 1 deletion.
    23 changes: 22 additions & 1 deletion gistfile1.yml
    Original file line number Diff line number Diff line change
    @@ -751,6 +751,9 @@ definitions:
    listing_id:
    type: string
    description: Unique identifier finding the listing
    ricardian_contract:
    type: string
    description: JSON Ricardian contract for the listing
    Case:
    properties:
    case_id:
    @@ -761,6 +764,12 @@ definitions:
    order_id:
    type: string
    description: Unique id for the Order
    state:
    type: string
    description: Current state of the Order
    ricardian_contract:
    type: string
    description: JSON Ricardian contract in current state
    SearchResult:
    properties:
    result:
    @@ -770,7 +779,19 @@ definitions:
    properties:
    message_id:
    type: string
    description: Unique id for the Message
    description: Unique id for the Message
    message_body:
    type: string
    description: Body of the message
    sender_id:
    type: string
    description: GUID of the sender
    recipient_id:
    type: string
    description: GUID of the recipient
    timestamp:
    type: datetime
    description: Date Timestamp when message was sent
    Error:
    properties:
    code:
  4. hoffmabc revised this gist Jul 7, 2015. 1 changed file with 9 additions and 9 deletions.
    18 changes: 9 additions & 9 deletions gistfile1.yml
    Original file line number Diff line number Diff line change
    @@ -38,7 +38,7 @@ paths:
    schema:
    $ref: '#/definitions/Error'
    /users/follow:
    put:
    post:
    summary: Follow a user
    description: |
    The *users/follow* endpoint adds the specified user at the GUID specified
    @@ -60,7 +60,7 @@ paths:
    schema:
    $ref: '#/definitions/Error'
    /users/unfollow:
    put:
    post:
    summary: Unfollow a user
    description: |
    The *users/unfollow* endpoint removes the specified user at the GUID specified
    @@ -160,7 +160,7 @@ paths:
    schema:
    $ref: '#/definitions/Error'
    /cases/refund_buyer:
    put:
    post:
    summary: Refund payment to a buyer for a specific case.
    description: |
    The *cases/refund_buyer* endpoint allows a moderator to refund a buyer for a
    @@ -181,7 +181,7 @@ paths:
    schema:
    $ref: '#/definitions/Error'
    /cases/pay_vendor:
    put:
    post:
    summary: Release payment to vendor for a specific case.
    description: |
    The *cases/pay_vendor* endpoint allows a moderator to release payment to a vendor
    @@ -202,7 +202,7 @@ paths:
    schema:
    $ref: '#/definitions/Error'
    /cases/split_payment:
    put:
    post:
    summary: Allows moderator to split escrow across both parties for a specific case.
    description: |
    The *cases/split_payment* endpoint allows a moderator to split the escrow amount
    @@ -257,7 +257,7 @@ paths:
    schema:
    $ref: '#/definitions/Error'
    /sales/refund:
    put:
    post:
    summary: Allows vendor to refund the buyer and cancel the order
    description: |
    The *sales/refund* endpoint allows the vendor to refund the buyer and cancel
    @@ -278,7 +278,7 @@ paths:
    schema:
    $ref: '#/definitions/Error'
    /sales/protest:
    put:
    post:
    summary: Allows vendor to protest the order to a moderator in event of a problem.
    description: |
    The *sales/protest* endpoint allows a vendor to notify the moderator of a problem
    @@ -333,7 +333,7 @@ paths:
    schema:
    $ref: '#/definitions/Error'
    /purchases/cancel:
    put:
    post:
    summary: Allows buyer to cancel in order and request a refund.
    description: |
    The *purchases/cancel* endpoint allows the buyer to cancel their order and request
    @@ -354,7 +354,7 @@ paths:
    schema:
    $ref: '#/definitions/Error'
    /purchases/protest:
    put:
    post:
    summary: Allows buyer to protest the order to a moderator in event of a problem.
    description: |
    The *purchases/protest* endpoint allows a buyer to notify the moderator of a problem
  5. hoffmabc revised this gist Jul 7, 2015. 1 changed file with 184 additions and 2 deletions.
    186 changes: 184 additions & 2 deletions gistfile1.yml
    Original file line number Diff line number Diff line change
    @@ -426,6 +426,11 @@ paths:
    description: Limits messages returned to this amount
    required: false
    type: number
    - name: show_cleared
    in: query
    description: Include messages that were previously cleared
    required: false
    type: boolean
    tags:
    - Messages
    responses:
    @@ -486,6 +491,173 @@ paths:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /messages/clear_conversation:
    post:
    summary: Mark all current visible messages with a user as hidden.
    description: |
    The *messages/clear_conversation* endpoint marks all visible messages
    with a specific user as hidden or cleared.
    parameters:
    - name: user_id
    in: query
    description: GUID of user to clear conversation for.
    required: true
    type: string
    tags:
    - Messages
    responses:
    200:
    description: No responses
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /search:
    get:
    summary: Search for anything on the network
    description: |
    The */search* endpoint returns information about anything matching the query on the network. This
    currently includes users, moderators, vendors and listings
    parameters:
    - name: query
    in: query
    description: Search term to look for on the network
    required: true
    type: string
    tags:
    - Search
    responses:
    200:
    description: Array containing SearchResult objects
    schema:
    type: object
    items:
    $ref: '#/definitions/SearchResult'
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /search/vendors:
    get:
    summary: Search for vendor users
    description: |
    The */search/vendors* endpoint returns information about matching vendors on the network
    parameters:
    - name: query
    in: query
    description: Search term to look for on the network
    required: true
    type: string
    tags:
    - Search
    responses:
    200:
    description: Array containing SearchResult objects
    schema:
    type: object
    items:
    $ref: '#/definitions/SearchResult'
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /search/moderators:
    get:
    summary: Search for moderator users
    description: |
    The */search/moderators* endpoint returns information about matching moderators on the network
    parameters:
    - name: query
    in: query
    description: Search term to look for on the network
    required: true
    type: string
    tags:
    - Search
    responses:
    200:
    description: Array containing SearchResult objects
    schema:
    type: object
    items:
    $ref: '#/definitions/SearchResult'
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /search/listings:
    get:
    summary: Search for listings on the network
    description: |
    The */search/listings* endpoint returns information about matching listings on the network
    parameters:
    - name: query
    in: query
    description: Search term to look for on the network
    required: true
    type: string
    tags:
    - Search
    responses:
    200:
    description: Array containing SearchResult objects
    schema:
    type: object
    items:
    $ref: '#/definitions/SearchResult'
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /search/listings:
    get:
    summary: Search for listings on the network
    description: |
    The */search/listings* endpoint returns information about matching listings on the network
    parameters:
    - name: query
    in: query
    description: Search term to look for on the network
    required: true
    type: string
    tags:
    - Search
    responses:
    200:
    description: Array containing SearchResult objects
    schema:
    type: object
    items:
    $ref: '#/definitions/SearchResult'
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /listings:
    get:
    summary: Retrieve current user's listings
    description: |
    The */listings* endpoint returns information about current user's listings on the network
    parameters:
    - name: query
    in: query
    description: Search term to filter the results
    required: false
    type: string
    tags:
    - Listings
    - Users
    responses:
    200:
    description: Array containing Listing objects
    schema:
    type: object
    items:
    $ref: '#/definitions/Listing'
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    definitions:
    User:
    properties:
    @@ -570,10 +742,15 @@ definitions:
    description: Unique identifier representing a node on the network.
    listings:
    type: object
    description: Array of raw listing objects
    description: Array of raw Listing objects
    count:
    type: number
    description: Number of listings returned
    description: Number of Listings returned
    Listing:
    properties:
    listing_id:
    type: string
    description: Unique identifier finding the listing
    Case:
    properties:
    case_id:
    @@ -584,6 +761,11 @@ definitions:
    order_id:
    type: string
    description: Unique id for the Order
    SearchResult:
    properties:
    result:
    type: object
    description: Any of the valid result types (i.e. User, Listing)
    Message:
    properties:
    message_id:
  6. hoffmabc revised this gist Jul 7, 2015. 1 changed file with 2 additions and 13 deletions.
    15 changes: 2 additions & 13 deletions gistfile1.yml
    Original file line number Diff line number Diff line change
    @@ -395,11 +395,11 @@ paths:
    - Settings
    responses:
    200:
    description: Object containing Settings data
    description: Object containing all User data
    schema:
    type: object
    items:
    $ref: '#/definitions/Settings'
    $ref: '#/definitions/User'
    default:
    description: Unexpected error
    schema:
    @@ -558,17 +558,6 @@ definitions:
    refund_address:
    type: string
    description: Bitcoin address to use for refunds
    Settings:
    properties:
    guid:
    type: string
    description: Unique identifier representing a node on the network.
    nickname:
    type: string
    description: Nickname on the network.
    bip32_seed:
    type: string
    description: BIP32 seed for OB wallet.
    UserReputation:
    properties:
    guid:
  7. hoffmabc revised this gist Jul 7, 2015. 1 changed file with 63 additions and 0 deletions.
    63 changes: 63 additions & 0 deletions gistfile1.yml
    Original file line number Diff line number Diff line change
    @@ -495,6 +495,69 @@ definitions:
    nickname:
    type: string
    description: Nickname on the network.
    firstname:
    type: string
    description: First name on the network.
    surname:
    type: string
    description: Surname on the network.
    email:
    type: string
    description: Email address
    nickname:
    type: string
    description: Nickname on the network.
    description:
    type: string
    description: Description of your store
    street1:
    type: string
    description: Street address line 1
    street2:
    type: string
    description: Street address line 2
    city:
    type: string
    description: City
    state_region:
    type: string
    description: State or region
    state_province_region:
    type: string
    description: State province or region
    zip:
    type: string
    description: Zip code
    telephone:
    type: string
    description: Telephone
    fax:
    type: string
    description: Fax number
    country:
    type: string
    description: Country
    countryCode:
    type: string
    description: Country code
    is_moderator:
    type: boolean
    description: Flag for if user is a moderator
    is_merchant:
    type: boolean
    description: Flag for if user is a merchant
    website:
    type: string
    description: Web site URL for business
    moderator_fee:
    type: number
    description: Percentage of fee for moderation
    moderator_services:
    type: string
    description: Description of services rendered as moderator
    refund_address:
    type: string
    description: Bitcoin address to use for refunds
    Settings:
    properties:
    guid:
  8. hoffmabc revised this gist Jul 7, 2015. 1 changed file with 0 additions and 20 deletions.
    20 changes: 0 additions & 20 deletions gistfile1.yml
    Original file line number Diff line number Diff line change
    @@ -465,26 +465,6 @@ paths:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /messages/mark_read:
    post:
    summary: Mark a message read
    description: |
    The *messages/mark_read* endpoint flags a message in the database as read.
    parameters:
    - name: message_id
    in: query
    description: ID of the message.
    required: true
    type: string
    tags:
    - Messages
    responses:
    200:
    description: No response
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /messages/clear_conversation:
    post:
    summary: Mark all current visible messages with a user as hidden.
  9. hoffmabc created this gist Jul 7, 2015.
    568 changes: 568 additions & 0 deletions gistfile1.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,568 @@
    swagger: '2.0'
    info:
    title: OpenBazaar API
    description: Let's make trade free
    version: "1.0.0"
    # the domain of the service
    host: localhost
    # array of all schemes that your API supports
    schemes:
    - http
    # will be prefixed to all paths
    basePath: /v1
    produces:
    - application/json
    paths:
    /users:
    get:
    summary: Interacting with users (vendors, buyers, moderators)
    description: |
    The *users* endpoint enables interaction with user objects
    parameters:
    - name: guid
    in: query
    description: GUID for the user on the network.
    required: true
    type: string
    tags:
    - Users
    responses:
    200:
    description: A user object in JSON
    schema:
    type: object
    items:
    $ref: '#/definitions/User'
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /users/follow:
    put:
    summary: Follow a user
    description: |
    The *users/follow* endpoint adds the specified user at the GUID specified
    to their follow list.
    parameters:
    - name: guid
    in: query
    description: GUID string
    required: true
    type: string
    format: string
    tags:
    - Users
    responses:
    200:
    description: No value returned
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /users/unfollow:
    put:
    summary: Unfollow a user
    description: |
    The *users/unfollow* endpoint removes the specified user at the GUID specified
    from their follow list.
    parameters:
    - name: guid
    in: query
    description: GUID string
    required: true
    type: string
    format: string
    tags:
    - Users
    responses:
    200:
    description: No value returned
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /users/reputation:
    get:
    summary: Retrieving reputation for a specific user on the network
    description: |
    The *users/reputation* endpoint allows retrieval of reputation info from the network
    parameters:
    - name: guid
    in: query
    description: GUID for the user on the network.
    required: true
    type: string
    tags:
    - Users
    responses:
    200:
    description: A user object in JSON
    schema:
    type: object
    items:
    $ref: '#/definitions/UserReputation'
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /users/listings:
    get:
    summary: Retrieving contract listings for a specific user on the network
    description: |
    The *users/listings* endpoint allows retrieval of listings info from the network
    parameters:
    - name: guid
    in: query
    description: GUID for the user on the network.
    required: true
    type: string
    - name: limit
    in: query
    description: Number of listings to limit request to before stopping
    required: false
    type: number
    tags:
    - Users
    - Listings
    responses:
    200:
    description: An array of listings
    schema:
    type: object
    items:
    $ref: '#/definitions/UserListings'
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /cases:
    get:
    summary: Retrieving moderator cases the current user is participating in.
    description: |
    The *cases* endpoint allows retrieval of current moderator cases.
    parameters:
    - name: limit
    in: query
    description: Number of cases to limit request to before stopping
    required: false
    type: number
    tags:
    - Cases
    responses:
    200:
    description: An array of Cases
    schema:
    type: array
    items:
    $ref: '#/definitions/Case'
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /cases/refund_buyer:
    put:
    summary: Refund payment to a buyer for a specific case.
    description: |
    The *cases/refund_buyer* endpoint allows a moderator to refund a buyer for a
    specified case.
    parameters:
    - name: case_id
    in: query
    description: id for the Case to be refunded
    required: true
    type: number
    tags:
    - Cases
    responses:
    200:
    description: No response expected
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /cases/pay_vendor:
    put:
    summary: Release payment to vendor for a specific case.
    description: |
    The *cases/pay_vendor* endpoint allows a moderator to release payment to a vendor
    for a specified case.
    parameters:
    - name: case_id
    in: query
    description: id for the Case to be paid out
    required: true
    type: number
    tags:
    - Cases
    responses:
    200:
    description: No response expected
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /cases/split_payment:
    put:
    summary: Allows moderator to split escrow across both parties for a specific case.
    description: |
    The *cases/split_payment* endpoint allows a moderator to split the escrow amount
    across multiple parties for a specified case (e.g. 50/50 split).
    parameters:
    - name: case_id
    in: query
    description: id for the Case to be refunded
    required: true
    type: number
    - name: amount_to_buyer
    in: query
    description: Percentage amount to refund to buyer (0 to 100)
    required: true
    type: number
    tags:
    - Cases
    responses:
    200:
    description: No response expected
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /sales:
    get:
    summary: Retrieving orders that the current user is the vendor for.
    description: |
    The *sales* endpoint allows retrieval of current sales orders.
    parameters:
    - name: limit
    in: query
    description: Number of orders to limit request to before stopping
    required: false
    type: number
    - name: filter
    in: query
    description: Filter for narrowing down list of orders to return.
    required: false
    type: string
    tags:
    - Orders
    responses:
    200:
    description: An array of Orders
    schema:
    type: array
    items:
    $ref: '#/definitions/Order'
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /sales/refund:
    put:
    summary: Allows vendor to refund the buyer and cancel the order
    description: |
    The *sales/refund* endpoint allows the vendor to refund the buyer and cancel
    their order.
    parameters:
    - name: order_id
    in: query
    description: id for the Order to be refunded and cancelled
    required: true
    type: number
    tags:
    - Orders
    responses:
    200:
    description: No response expected
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /sales/protest:
    put:
    summary: Allows vendor to protest the order to a moderator in event of a problem.
    description: |
    The *sales/protest* endpoint allows a vendor to notify the moderator of a problem
    and send a short message describing the issue.
    parameters:
    - name: order_id
    in: query
    description: id for the Order to be disputed
    required: true
    type: number
    - name: message_to_mod
    in: query
    description: Message to the moderator describing the reason for protest.
    required: true
    type: string
    tags:
    - Orders
    responses:
    200:
    description: No response expected
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /purchases:
    get:
    summary: Retrieving orders that the current user is the buyer in.
    description: |
    The *purchases* endpoint allows retrieval of current purchases.
    parameters:
    - name: limit
    in: query
    description: Number of orders to limit request to before stopping
    required: false
    type: number
    - name: filter
    in: query
    description: Filter for narrowing down list of orders to return.
    required: false
    type: string
    tags:
    - Orders
    responses:
    200:
    description: An array of Orders
    schema:
    type: array
    items:
    $ref: '#/definitions/Order'
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /purchases/cancel:
    put:
    summary: Allows buyer to cancel in order and request a refund.
    description: |
    The *purchases/cancel* endpoint allows the buyer to cancel their order and request
    a refund.
    parameters:
    - name: order_id
    in: query
    description: id for the Order to be refunded and cancelled
    required: true
    type: number
    tags:
    - Orders
    responses:
    200:
    description: No response expected
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /purchases/protest:
    put:
    summary: Allows buyer to protest the order to a moderator in event of a problem.
    description: |
    The *purchases/protest* endpoint allows a buyer to notify the moderator of a problem
    and send a short message describing the issue.
    parameters:
    - name: order_id
    in: query
    description: id for the Order to be disputed
    required: true
    type: number
    - name: message_to_mod
    in: query
    description: Message to the moderator describing the reason for protest.
    required: true
    type: string
    tags:
    - Orders
    responses:
    200:
    description: No response expected
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /settings:
    get:
    summary: Retrieve an object containing all the settings for the current user.
    description: |
    The *settings* endpoint allows a user to retrieve all current settings and
    configuration and information.
    parameters:
    - name: include_sensitive
    in: query
    description: flag for disclosing sensitive data (i.e. keys) in response
    required: false
    type: number
    tags:
    - Settings
    responses:
    200:
    description: Object containing Settings data
    schema:
    type: object
    items:
    $ref: '#/definitions/Settings'
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /messages:
    get:
    summary: Retrieve messages from private inbox
    description: |
    The *messages* endpoint allows a user to retrieve all messages in their private
    inbox for OpenBazaar.
    parameters:
    - name: from_user
    in: query
    description: Filters out messages from everyone but this GUID
    required: false
    type: string
    - name: to_user
    in: query
    description: Filters out messages not to this GUID
    required: false
    type: string
    - name: count
    in: query
    description: Limits messages returned to this amount
    required: false
    type: number
    tags:
    - Messages
    responses:
    200:
    description: Array containing Message objects
    schema:
    type: object
    items:
    $ref: '#/definitions/Message'
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /messages/send:
    post:
    summary: Send a new private message to another user
    description: |
    The *messages/send* endpoint allows a user to send a private message to
    another online OpenBazaar user.
    parameters:
    - name: body
    in: query
    description: Body of the message.
    required: true
    type: string
    - name: recipient_id
    in: query
    description: GUID for user to send message to.
    required: true
    type: string
    tags:
    - Messages
    responses:
    200:
    description: No response
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /messages/mark_read:
    post:
    summary: Mark a message read
    description: |
    The *messages/mark_read* endpoint flags a message in the database as read.
    parameters:
    - name: message_id
    in: query
    description: ID of the message.
    required: true
    type: string
    tags:
    - Messages
    responses:
    200:
    description: No response
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    /messages/clear_conversation:
    post:
    summary: Mark all current visible messages with a user as hidden.
    description: |
    The *messages/clear_conversation* endpoint marks all visible messages
    with a specific user as hidden or cleared.
    parameters:
    - name: user_id
    in: query
    description: GUID of user to clear conversation for.
    required: true
    type: string
    tags:
    - Messages
    responses:
    200:
    description: No responses
    default:
    description: Unexpected error
    schema:
    $ref: '#/definitions/Error'
    definitions:
    User:
    properties:
    guid:
    type: string
    description: Unique identifier representing a node on the network.
    nickname:
    type: string
    description: Nickname on the network.
    Settings:
    properties:
    guid:
    type: string
    description: Unique identifier representing a node on the network.
    nickname:
    type: string
    description: Nickname on the network.
    bip32_seed:
    type: string
    description: BIP32 seed for OB wallet.
    UserReputation:
    properties:
    guid:
    type: string
    description: Unique identifier representing a node on the network.
    UserListings:
    properties:
    guid:
    type: string
    description: Unique identifier representing a node on the network.
    listings:
    type: object
    description: Array of raw listing objects
    count:
    type: number
    description: Number of listings returned
    Case:
    properties:
    case_id:
    type: string
    description: Unique id for the moderator Case
    Order:
    properties:
    order_id:
    type: string
    description: Unique id for the Order
    Message:
    properties:
    message_id:
    type: string
    description: Unique id for the Message
    Error:
    properties:
    code:
    type: integer
    format: int32
    message:
    type: string
    fields:
    type: string