Flecto
    • Activities
    • Timestamps
    • Flecto AI
      • Flecto AI
      • Hint item categories
        GET
      • Classify insurance item
        GET
    • Services
      • Get image upload url
        POST
      • Get document upload url
        POST
    • Integrations - Email Validate
      • Validation email
        GET
    • Integrations - Google Calendar
      • Google Calendar Integration
      • Create google calendar id
        POST
      • Delete google calendar
        DELETE
    • Me
      • Gets current logged in user
        GET
      • Update current logged in user attributes
        PUT
    • Me - Identities
      • Get user identities
        GET
      • Change main identity
        POST
      • send email for recovery password
        POST
      • Get user identities
        GET
      • delete auth0 user
        DELETE
      • Update identity
        PUT
    • Me - Subscription
      • Get user subscription
        GET
      • Get user subscription plan
        GET
    • Me - Tax Profiles
      • Get current user tax profile
        GET
      • Update current user tax profile
        PUT
    • Business Categories
      • Get business categories
    • SaaS - Bookings
      • Creates a booking
      • Index all bookings
      • Updates booking
      • Show details of one booking
      • Delete booking
    • SaaS - Booking Availability
      • Checks product availability for all items within booking
    • SaaS - Booking Customers
      • Shows booking customer
      • Update booking customer
    • SaaS - Booking Items
      • Check booking product availability
      • Booking items
      • Add a new booking item
      • Booking item
      • Remove a booking item
      • Update booking item
    • SaaS - Booking Payments
      • Shows all booking payment
      • Creates a booking payment
      • Shows booking payment
      • Destroy booking payment
      • Updates a booking payment
    • SaaS - Booking Status
      • Turns taxable off for all booking products
      • Turns taxable on for all booking products
      • Negotiate booking
      • Reserve booking
      • Cancel a booking
      • Halts booking negotiation
      • Unreserve booking
      • Halts ongoing negotiation
      • Reverts completed booking
      • Undo cancelled booking
    • SaaS - Bundles
      • Get items
      • Create bundle
      • Get bundle
      • Update bundle
      • Delete bundle
    • SaaS - Bundles Items
      • Get bundle items
      • Create bundle item
      • Get bundle items
      • Update bundle item
      • Delete bundle item
    • SaaS - Chargebee
      • Posts callback from Chargebee
    • SaaS - Items
      • Get item category
      • Get item
      • Delete items
      • Update item
      • Add item
      • Get items
      • Get items
    • SaaS - Insurances
      • Create insurances for booking
      • Cancels bookings insurances
      • List all bookings insurances
      • Get insurance stats
      • Show booking insurance
      • Show booking insurance status
      • Get Insurance Quote for booking
    • SaaS - Products
      • Get item
      • Checks product availability for booking
      • Checks availability for all items
    • Me - Onboarding
      • Onboards a new user
    • SaaS - Booking Services
      • Shows all booking services
      • create a booking service
      • Delete booking service
      • Shows booking service
      • Update booking service
    • SaaS - Product Status
      • Enable Product
      • Disable Product
    • Org - Insurance Claims
      • Get claim
      • Get claim
      • Create claim
      • List all claims
    • Org - Insurance Documents
      • Contract preview
      • Shows all insurance documents
      • Creates a insurance document
      • Generates a contract PDF for an insurance
      • Shows insurance document
      • Destroy insurance document
      • Updates a insurance document
    • Org - Insurances
      • Preview insurance from document
      • Previews insurance for extending a policy
      • Cancel insurance
      • Get insurance
      • Update insurance
      • Get insurance Quote for extending a policy
      • Extend insurance
      • Create insurance
      • List all insurances
    • Org - Insurance Claim Documents
      • List claim documents
      • Create claim document
      • Get claim document
      • Delete claim document
    • Org - Contracts
      • Add insurances to contract
      • Show contract
      • Update contract
      • Create contract
      • List contracts
    • Org - Customer Addresses
      • List customer addresses
      • Creates a customer addresses
      • Delete address
      • Update address
    • Org - Insurance Emails
      • Send insurance customer email
    • Org - Item Categories
      • List all item categories
      • Create item category
      • Move item category
      • Get item category
      • Update item category
      • Delete item category
    • Org - Item Documents
      • Shows all item documents
      • Creates an item document
      • Shows item document
      • Destroy item document
      • Updates a item document
    • Org - Items
      • Batch quote insurance for multiple items
      • Estimate insurance for item
    • Org - Addresses
      • Get all user addresses
      • Create user address
      • Get user address
      • Delete user address
      • Update user address
    • Org - Customers
      • Creates a customer
      • List customers
      • Get customer
      • Delete customer
      • Updates customer
    • SaaS - Booking Products
      • Batch update booking products
    • Org - Documents
      • Update document
    • Schemas
      • date_string
      • document_metadata
      • contract_update
      • item_document_create
      • item_document_update
      • insurance_extend
      • insurance_update
      • insurance_claim_create
      • insurance_claim_document_create
      • tax_profile_update
      • bundle_item_create
      • bundle_item_update
      • booking_service_create
      • insurance_send_email
      • onboarding
      • item_category_create
      • item_category_update
      • booking_payment_create
      • booking_payment_update
      • booking_service_update
      • customer_address_create
      • insurance_document_update
      • insurance_document_pdf_create
      • customer_address_update
      • booking_product_update
      • insurance_create
      • insurance_document_create
      • bundle_create
      • bundle_update
      • batch_quote
      • user_update
      • contract_create
      • contract_add_insurances
      • customer_create
      • customer_update
      • booking_update
      • booking_product_create
      • booking_product_batch
      • item_create
      • item_update
      • booking_create
      • org_address_create
      • org_address_update

    Activities

    Activity#

    Activities are form of registering the actions performed during a booking.

    They're divided into 2 main types:
    comment (created by the users)
    actions (triggered by the backend).

    GET /api/saas/me/bookings/{booking_internal_id}/activities#

    Description:#

    Returns a list of all activities associated to the booking, sorted by created_at: :descending, kind: :descending by default.

    Parameters:#

    Authorization
    Location: header
    Type: string
    Required: true
    Description: The authentication token required to access the endpoint.
    Auth0-IdToken
    Location: header
    Type: string
    Required: false
    Description: The auth0 idToken from the user.
    Accept-Language
    Location: header
    Type: number
    Required: false
    Description: Response language, en and pt are supported.
    booking_internal_id
    Location: path
    Type: number
    Required: true
    Description: The internal ID of the booking.

    Request Example:#

    Response Example:#

    {
      "data": [
        {
          "id": "10",
          "type": "activity",
          "attributes": {
            "kind": "booking_item_returned",
            "properties": {
              "attrs": ["returned_quantity"],
              "params": { "new": 1, "old": 0 }
            },
            "created_at": "2024-03-24T15:15:00Z",
            "updated_at": "2024-03-24T15:15:00Z"
          }
        },
        {
          "id": "9",
          "type": "activity",
          "attributes": {
            "kind": "booking_status_changed",
            "properties": {
              "attrs": ["status"],
              "params": { "new": "completed", "old": "ongoing" }
            },
            "created_at": "2024-03-24T15:15:00Z",
            "updated_at": "2024-03-24T15:15:00Z"
          }
        },
        {
          "id": "8",
          "type": "activity",
          "attributes": {
            "kind": "booking_item_picked_up",
            "properties": {
              "attrs": ["picked_up_quantity"],
              "params": { "new": 1, "old": 0 }
            },
            "created_at": "2024-03-23T15:15:00Z",
            "updated_at": "2024-03-23T15:15:00Z"
          }
        },
        {
          "id": "7",
          "type": "activity",
          "attributes": {
            "kind": "booking_status_changed",
            "properties": {
              "attrs": ["status"],
              "params": { "new": "ongoing", "old": "reserved" }
            },
            "created_at": "2024-03-23T15:15:00Z",
            "updated_at": "2024-03-23T15:15:00Z"
          }
        },
        {
          "id": "6",
          "type": "activity",
          "attributes": {
            "kind": "booking_status_changed",
            "properties": {
              "attrs": ["status"],
              "params": { "new": "reserved", "old": "drafting" }
            },
            "created_at": "2024-03-22T15:29:46Z",
            "updated_at": "2024-03-22T15:29:46Z"
          }
        },
        {
          "id": "5",
          "type": "activity",
          "attributes": {
            "kind": "booking_service_created",
            "properties": {
              "attrs": ["created_at"],
              "params": { "service_kind": "insurance" }
            },
            "created_at": "2024-03-22T15:29:46Z",
            "updated_at": "2024-03-22T15:29:46Z"
          }
        },
        {
          "id": "4",
          "type": "activity",
          "attributes": {
            "kind": "booking_item_created",
            "properties": {
              "attrs": ["created_at"],
              "params": { "item_title": "Mediocre Marble Coat" }
            },
            "created_at": "2024-03-22T15:29:46Z",
            "updated_at": "2024-03-22T15:29:46Z"
          }
        },
        {
          "id": "2",
          "type": "activity",
          "attributes": {
            "kind": "booking_customer_set",
            "properties": {
              "attrs": ["customer_id"],
              "params": { "customer_internal_id": 2 }
            },
            "created_at": "2024-03-22T15:29:46Z",
            "updated_at": "2024-03-22T15:29:46Z"
          }
        },
        {
          "id": "3",
          "type": "activity",
          "attributes": {
            "kind": "booking_changed_dates",
            "properties": {
              "attrs": ["start_at", "end_at"],
              "params": {
                "new_end_at": "2024-03-24T15:15:00.000Z",
                "old_end_at": null,
                "new_start_at": "2024-03-23T15:15:00.000Z",
                "old_start_at": null
              }
            },
            "created_at": "2024-03-22T15:29:46Z",
            "updated_at": "2024-03-22T15:29:46Z"
          }
        },
        {
          "id": "1",
          "type": "activity",
          "attributes": {
            "kind": "booking_created",
            "properties": {
              "attrs": ["created_at"],
              "params": { "booking_id": 1 }
            },
            "created_at": "2024-03-22T15:29:46Z",
            "updated_at": "2024-03-22T15:29:46Z"
          }
        }
      ]
    }
    

    Endpoint#

    POST /api/saas/me/bookings/{booking_internal_id}/activities

    Description:#

    Creates a new comment activity.

    Parameters:#

    Authorization
    Location: header
    Type: string
    Required: true
    Description: The authentication token required to access the endpoint.
    Auth0-IdToken
    Location: header
    Type: string
    Required: false
    Description: The auth0 idToken from the user.
    Accept-Language
    Location: header
    Type: number
    Required: false
    Description: Response language, en and pt are supported.
    booking_internal_id
    Location: path
    Type: number
    Required: true
    Description: The internal ID of the booking.
    activity
    Location: body
    Required: true
    Description: The content of the activity to be processed.

    Activity Attributes:#

    comment
    Type: string
    Description: The comment message.
    Limit: 4000 characters.
    attachment_id
    Type: string
    Description: The signed id for document attachment.
    Size Limit: 10 MB

    Request Example:#

    curl -X POST http://rnters-staging.herokuapp.com/api/saas/me/bookings/{booking_internal_id}/activities \
    -H 'Authorization: Bearer your_token' \
    -H 'Auth0-IdToken: your_id_token' \
    -H 'Accept-Language: en' \
    -H 'Content-Type: application/json' \
    -d '{
      "data": {
        "type": "activity",
        "attributes": {
          "properties": {
            "comment": "sample comment"
          },
          "attachment_id": "sample-signed-id"
        }
      }
    }'

    Response Example:#

    {
      "data": {
        "id": "8",
        "type": "activity",
        "attributes": {
          "kind": "comment",
          "properties": { "comment": "sample comment" },
          "created_at": "2024-03-23T13:54:01Z",
          "updated_at": "2024-03-23T13:54:01Z",
          "attachment_url": "FILE_URL",
          "attachment_preview": "PREVIEW_URL",
          "attachment_filename": "dummy.pdf",
          "attachment_content_type": "application/pdf",
          "attachment_metadata": {}
        }
      }
    }
    

    Endpoint#

    PUT /api/saas/me/bookings/{booking_internal_id}/activities/{id}

    Description:#

    Updates a comment activity.

    Parameters:#

    Authorization
    Location: header
    Type: string
    Required: true
    Description: The authentication token required to access the endpoint.
    Auth0-IdToken
    Location: header
    Type: string
    Required: false
    Description: The auth0 idToken from the user.
    Accept-Language
    Location: header
    Type: number
    Required: false
    Description: Response language, en and pt are supported.
    booking_internal_id
    Location: path
    Type: number
    Required: true
    Description: The internal ID of the booking.
    id
    Location: path
    Type: number
    Required: true
    Description: The id of the activity.
    activity
    Location: body
    Required: true
    Description: The content of the activity to be processed.

    Activity Attributes:#

    comment
    Type: string
    Description: The comment message.
    Limit: 4000 characters.
    attachment_id
    Type: string
    Description: The signed id for document attachment.
    Size Limit: 10 MB

    Request Example:#

    Response Example:#

    {
      "data": {
        "id": "456",
        "type": "activity",
        "attributes": {
          "comment": "Updated comment",
          "created_at": "2024-03-22T15:29:46Z",
          "updated_at": "2024-03-24T15:15:00Z"
        }
      }
    }

    Endpoint#

    DELETE /api/saas/me/bookings/{booking_internal_id}/activities/{id}

    Description:#

    Deletes a comment activity.

    Parameters:#

    Authorization
    Location: header
    Type: string
    Required: true
    Description: The authentication token required to access the endpoint.
    Auth0-IdToken
    Location: header
    Type: string
    Required: false
    Description: The auth0 idToken from the user.
    Accept-Language
    Location: header
    Type: number
    Required: false
    Description: Response language, en and pt are supported.
    booking_internal_id
    Location: path
    Type: number
    Required: true
    Description: The internal ID of the booking.
    id
    Location: path
    Type: number
    Required: true
    Description: The id of the activity.

    Request Example:#

    Modified at 2024-03-23 14:29:43
    Next
    Timestamps
    Built with