# docs.info
Getting Started¶ ↑

All links below should be prefixed with api.goodcity.hk

Architecture / Diagrams¶ ↑

API Controllers and Actions

Database Models (overview of relationships)

Database Models (full schema)

Authentication¶ ↑

See /api/docs/v1/authentication.html

Language¶ ↑

Some taxonomy lists such as ItemTypes, Districts and Territories have Traditional Chinese 中文 translations. When sending an API request, include the following header to set the language. This will return translated data (where applicable). If no language header is set or the language requested is not available, the API will default to English.

The Accept-Language headers allows the following options:

Accept-Language: en
Accept-Language: zh-tw

English¶ ↑

{
  territory: {
    id: 1,
    name: "New Territories"
  }
}

Traditional Chinese¶ ↑

{
  territory: {
    id: 1,
    name: "新界"
  }
}

Permissions¶ ↑

The API will only provide access to objects the authenticated user has permission to see. For example: when a donor lists all offers, only offers they have created are returned. When a Reviewer views all offers, they will see everything.

Validation Error Handling¶ ↑

Validation errors return status 422 Unprocessable Entity and will generally include a json errors attributes hash. For example:

{
  errors:
    {
      mobile: "is invalid"
    }
}

Server responses (non 2XX)¶ ↑

If you send a request to the server without the correct parameters, the response will be 400 Bad Request

{
  error: "Bad Request"
}

401 Unauthorized errors return the following format:

{
  error: "Invalid token"
}

If there is a 500 Server Error, it will be returned in the following format:

{
  error: "Internal Server Error"
}

Serialization¶ ↑

API v1¶ ↑

All responses are serialized in JSON format. Objects are serialized using ActiveModelSerializer.

Partial example:

{
  "offer" : {
    "id" : 1731,
    "language" : "en",
    "state" : "draft",
    "origin" : "web",
    "stairs" : false,
    "parking" : false,
    "estimated_size" : "4"
  }
}

Please refer to a specific controller for more detailed examples.

Side-loading¶ ↑

Objects that contain related data may also include those relationships to reduce the number of API requests required.

In the following example, an API call has been made to /api/v1/territories/306. The response payload includes both the territory attributes and the related districts.

{
  "districts" : [
    {
      "id" : 118,
      "name" : "Shek Kong",
      "territory_id" : 306
    },
    {
      "id" : 119,
      "name" : "Tsz Wan Shan",
      "territory_id" : 306
    },
  ],
  "territory" : {
    "id" : 306,
    "name" : "New Territories",
    "district_ids" : [
      118,
      119,
    ]
  }
}

API v2¶ ↑

All responses are serialized in the JSON API format. Objects are serialized using JSON:API.

Example

{

"data": {
  "id": "3",
  "type": "movie",
  "attributes": {
    "name": "test movie",
    "year": null
  },
  "relationships": {
    "actors": {
      "data": [
        {
          "id": "1",
          "type": "actor"
        },
        {
          "id": "2",
          "type": "actor"
        }
      ]
    },
    "owner": {
      "data": {
        "id": "3",
        "type": "user"
      }
    }
  }
}

}

Please refer to a specific controller for more detailed examples.

# docs.resources.access_passes.methods[].params[].params[].description
Array of Role Ids

# docs.resources.access_passes.methods[].params[].params[].description
access_expires_at

# docs.resources.access_passes.methods[].params[].params[].description
Printer Id

# docs.resources.addresses.short_description
List and create addresses for Contacts and Users

# docs.resources.addresses.methods[].params[].params[].description
Street name

# docs.resources.addresses.methods[].params[].params[].description
Flat name

# docs.resources.addresses.methods[].params[].params[].description
Building name

# docs.resources.addresses.methods[].params[].params[].description
Hong Kong district

# docs.resources.addresses.methods[].params[].params[].description
Type of address, usually 'Collection' or 'Profile'

# docs.resources.addresses.methods[].params[].params[].description
Object the address belongs to: 'Contact' or 'User' (Polymorphic)

# docs.resources.addresses.methods[].params[].params[].description
Object id of the associated polymorphic record. Use contact_id or user_id

# docs.resources.addresses.methods[].params[].params[].description
Delivery instructions and other notes

# docs.resources.addresses.methods[].examples[]
POST /api/v1/addresses
{
  "address": {
    "flat": "Apt. 180",
    "building": "2858",
    "street": "Flatley Villages",
    "address_type": "Collection",
    "addressable_id": "1850",
    "addressable_type": "Contact",
    "district_id": "2032"
  }
}
201
{
  "address": {
    "id": 1850,
    "street": "Flatley Villages",
    "flat": "Apt. 180",
    "building": "2858",
    "district_id": 2032,
    "addressable_id": 1850,
    "addressable_type": "Contact"
  }
}

# docs.resources.appointment_slot_presets.short_description
Manage a list of appointment slot templates for days of the week.

# docs.resources.appointment_slots.short_description
Manage a list of appointment quotas for special days

# docs.resources.appointment_slots.methods[].apis[].short_description
List upcoming appointment slots aggregated by dates

# docs.resources.authentication.full_description
The login process (in brief):¶ ↑

User sends mobile number to /auth/send_pin

If the user exists, the server sends a 4-digit pin (OTP code) via SMS to the mobile number

Server responds with otp_auth_key

User calls /auth/verify with OTP code AND otp_auth_key

Server successfully authenticates and returns jwt_token

jwt_token is sent with all API requests requiring authorization

Diagrams¶ ↑

A fuller explanation of the user login / registration process is detailed in the following flowchart diagrams.

Login flowchart

Registration flowchart

JWT Token¶ ↑

When sending the JWT token to authenticate each request, place it in the request header using the “Authorization Bearer” scheme. Example: Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE0MTc1NzkwMTQsImlzcyI6Ikdvb2RDaXR5VGVzdCIsImV4cCI6MTQxNzU4MDgxNH0.x-N_aUb3S5wcNy5i2w2WUZjEA2ud_81u8yQV0JfsT6A

# docs.resources.authentication.methods[].full_description
Send an OTP code via SMS if the given mobile number has an account in the system. Each time a new OTP code is generated, the otp_auth_key is cycled. The client is responsible for sending back the newest otp_auth_key with the OTP code. If the user account doesn't exist, a random otp_auth_key is returned.

Response status codes¶ ↑

200 - returned regardless of whether mobile number exists or not

422 - returned if the mobile number is invalid

# docs.resources.authentication.methods[].errors[].description
Invalid mobile number - if mobile prefix doesn't start with +852

# docs.resources.authentication.methods[].params[].description
Mobile number with prefixed country code e.g. +85262345678

# docs.resources.authentication.methods[].examples[]
// This is an example of send pin with valid host and valid mobile number
POST /api/v1/auth/send_pin
{
  "mobile": "+85261677528"
}
200
{
  "otp_auth_key": "/JqONEgEjrZefDV3ZIQsNA=="
}

# docs.resources.authentication.methods[].examples[]
// This is an example of send pin unregistered mobile number
POST /api/v1/auth/send_pin
{
  "mobile": "+85251641822"
}
200
{
  "otp_auth_key": "/JqONEgEjrZefDV3ZIQsNA=="
}

# docs.resources.authentication.methods[].examples[]
// This is an example of send pin with invalid host
POST /api/v1/auth/send_pin
{
  "mobile": "+85260274677"
}
403
{
  "errors": "Invalid host"
}

# docs.resources.authentication.methods[].examples[]
// This is an example of send pin with empty mobile number
POST /api/v1/auth/send_pin
{
  "mobile": ""
}
422
{
  "errors": "Mobile can't be blank"
}

# docs.resources.authentication.methods[].examples[]
// This is an example of send pin with invalid mobile number
POST /api/v1/auth/send_pin
{
  "mobile": "+9101234567"
}
422
{
  "errors": "Mobile must begin with +852"
}

# docs.resources.authentication.methods[].full_description
Create a new user and send an OTP token to the user's mobile. If the mobile number already exists, do not create a new user. Send an OTP code to the existing user's mobile and disregard any other signup params.

If successful:¶ ↑

an OTP code will be sent via SMS to the user's mobile

an otp_auth_key will be returned to the client

Hong Kong mobile numbers¶ ↑

must begin with +8525, +8526, or +8529

must contain a further 7 digits.

Valid examples:¶ ↑

+85251234567

+85261234567

+85291234567

Invalid examples:¶ ↑

+11112345678 - must begin with +8525, +8526, or +8529

+85212345678 - must begin with +8525, +8526, or +8529

+8525234567 - too short

+852523456789 - too long

To understand the registration process in detail please refer to the attached Registration flowcharts

# docs.resources.authentication.methods[].params[].params[].description
Mobile number e.g. +85212345678

# docs.resources.authentication.methods[].params[].params[].description
Given name (first name)

# docs.resources.authentication.methods[].params[].params[].description
Family name (last name)

# docs.resources.authentication.methods[].params[].params[].params[].description
Hong Kong district

# docs.resources.authentication.methods[].params[].params[].params[].description
Type of address e.g. 'Profile' or 'Collection'

# docs.resources.authentication.methods[].examples[]
POST /api/v1/auth/signup
{
  "user_auth": {
    "mobile": "+85251224538",
    "first_name": "Jake",
    "last_name": "Deamon",
    "address_attributes": {
      "district_id": "1",
      "address_type": "Profile"
    }
  }
}
200
{
  "otp_auth_key": "/JqONEgEjrZefDV3ZIQsNA=="
}

# docs.resources.authentication.methods[].full_description
Verify the OTP code (sent via SMS)

If verified, generate and send back an authenticated jwt_token and user object

If verification fails, return 422 (Unprocessable Entity)

If successful¶ ↑

a jwt_token will be returned. This should be included in all subsequent requests as part of the AUTHORIZATION header to authenticate the API calls.

the user object is returned.

To understand the registration process in detail refer attached Login flowchart

# docs.resources.authentication.methods[].params[].description
OTP code received via SMS

# docs.resources.authentication.methods[].params[].description
The authentication key received during 'send_pin' or 'signup' steps

# docs.resources.authentication.methods[].examples[]
POST /api/v1/auth/verify
{
  "otp_auth_key": "/JqONEgEjrZefDV3ZIQsNA==",
  "pin": "1234"
}
200
{
  "jwt_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE0MTc1NzkwMTQsImlzcyI6Ikdvb2RDaXR5VGVzdCIsImV4cCI6MTQxNzU4MDgxNH0.x-N_aUb3S5wcNy5i2w2WUZjEA2ud_81u8yQV0JfsT6A",
  "user": {
    "addresses": [
      {
        "id": 1857,
        "street": "Schmeler Parks",
        "flat": "Suite 609",
        "building": "58752",
        "district_id": 2038,
        "addressable_id": 1831,
        "addressable_type": "User"
      }
    ],
    "permissions": [],
    "user_profile": {
      "id": 1831,
      "first_name": "Reynold",
      "last_name": "Lakin",
      "mobile": "98353103",
      "address_id": 1857,
      "permission_id": null
    }
  }
}

# docs.resources.authentication.methods[].apis[].short_description
Retrieve current authenticated user profile details

# docs.resources.authentication.methods[].apis[].short_description
Register a mobile device to receive notifications

# docs.resources.authentication.methods[].params[].description
The registration id for the push messaging service for the platform i.e. fcm/gcm registration id for android

# docs.resources.authentication.methods[].params[].description
The azure notification platform name, this should be `fcm/gcm` for android

# docs.resources.authentication.methods[].apis[].short_description
Retrieve the list of socketio rooms the user can listen to

# docs.resources.canned_responses.methods[].params[].description
Indicates the USER or SYSTEM canned_messages

# docs.resources.canned_responses.methods[].params[].params[].description
English name for the canned_response

# docs.resources.canned_responses.methods[].params[].params[].description
Chinese name for the canned_response

# docs.resources.canned_responses.methods[].params[].params[].description
English content for the canned_response

# docs.resources.canned_responses.methods[].params[].params[].description
Chinese content for the canned_response

# docs.resources.canned_responses.methods[].params[].description
ID of the canned_response to be deleted

# docs.resources.canned_responses.methods[].full_description
A list of GUID's for the messages

.

logistics-complete-review-message: Message to load when offer is reviewed and transportation needs to be arranged.
review-offer-close-offer-message: Message to load when offer is rejected.
review-offer-missing-offer-message: Message to load when delivery is done but the items are missing.
review-offer-receive-offer-message: Message to load when all items of offers are recieved successfully.

# docs.resources.companies.methods[].params[].params[].description
name of the company

# docs.resources.companies.methods[].params[].params[].description
CRM Id

# docs.resources.companies.methods[].params[].params[].description
Id of user who created company record

# docs.resources.computer_accessories.short_description
Create, update and show a computer_accessory.

# docs.resources.computer_accessories.methods[].params[].params[].description
name of the brand

# docs.resources.computer_accessories.methods[].params[].params[].description
model of the record

# docs.resources.computer_accessories.methods[].params[].params[].description
serial number of the record

# docs.resources.computer_accessories.methods[].params[].params[].description
size of the record

# docs.resources.computer_accessories.methods[].params[].params[].description
interface of the record

# docs.resources.computer_accessories.methods[].params[].params[].description
comp_voltage of the record

# docs.resources.computer_accessories.methods[].params[].params[].description
comp_test_status of the record

# docs.resources.computer_accessories.methods[].params[].params[].description
updated_by_id of the record

# docs.resources.computers.methods[].params[].params[].description
name of the brand

# docs.resources.computers.methods[].params[].params[].description
model of the computer

# docs.resources.computers.methods[].params[].params[].description
serial number of the computer

# docs.resources.computers.methods[].params[].params[].description
size of the computer

# docs.resources.computers.methods[].params[].params[].description
cpu of the computer

# docs.resources.computers.methods[].params[].params[].description
ram of the computer

# docs.resources.computers.methods[].params[].params[].description
hdd of the computer

# docs.resources.computers.methods[].params[].params[].description
optical of the computer

# docs.resources.computers.methods[].params[].params[].description
video of the computer

# docs.resources.computers.methods[].params[].params[].description
sound of the computer

# docs.resources.computers.methods[].params[].params[].description
lan of the computer

# docs.resources.computers.methods[].params[].params[].description
wireless of the computer

# docs.resources.computers.methods[].params[].params[].description
usb of the computer

# docs.resources.computers.methods[].params[].params[].description
volage of the computer

# docs.resources.computers.methods[].params[].params[].description
operating system of the computer

# docs.resources.computers.methods[].params[].params[].description
serial number of the OS of the computer

# docs.resources.computers.methods[].params[].params[].description
ms office serial num of the computer

# docs.resources.computers.methods[].params[].params[].description
mar os serial num of the computer

# docs.resources.computers.methods[].params[].params[].description
mar ms office serial num of the computer

# docs.resources.computers.methods[].params[].params[].description
id of the user who updated computer record

# docs.resources.contacts.short_description
Manage contact details for offer collection / delivery

# docs.resources.contacts.methods[].params[].params[].description
Full name of contact

# docs.resources.contacts.methods[].params[].params[].description
Contact mobile number

# docs.resources.deliveries.full_description
Delivery relationships¶ ↑

Generated using

gem install railroady
railroady -s app/models/delivery.rb,app/models/gogovan_order.rb,app/models/schedule.rb,app/models/address.rb,app/models/offer.rb,app/models/contact.rb -M | dot -Tpng > deliveries.png

# docs.resources.deliveries.methods[].params[].params[].description
Id of offer to which delivery belongs.

# docs.resources.deliveries.methods[].params[].params[].description
Id of contact to which delivery belongs.

# docs.resources.deliveries.methods[].params[].params[].description
Id of schedule to which delivery belongs.

# docs.resources.deliveries.methods[].params[].params[].description
Delivery type.

# docs.resources.deliveries.methods[].params[].params[].validator
Must be one of: Alternate, Drop Off, Gogovan.

# docs.resources.deliveries.methods[].params[].params[].description
Not yet used

# docs.resources.deliveries.methods[].params[].params[].description
Not yet used

# docs.resources.deliveries.methods[].examples[]
// This is an example of creating delivery. TO create delivery of specific type values should be from ['Alternate', 'Drop Off', 'Gogovan']
POST /api/v1/deliveries
{
  "delivery": {
    "delivery_type": "Gogovan"
  }
}
201
{
  "contacts": [],
  "schedules": [],
  "gogovan_orders": [],
  "delivery": {
    "id": 178,
    "start": null,
    "finish": null,
    "offer_id": null,
    "delivery_type": "Gogovan",
    "contact_id": null,
    "schedule_id": null,
    "gogovan_order_id": null
  }
}

# docs.resources.deliveries.methods[].examples[]
// This is an example of 'Drop Off Delivery'
GET /api/v1/deliveries/176
200
{
  "contacts": [],
  "schedules": [
    {
      "id": 4,
      "resource": null,
      "scheduled_at": "2015-02-20T15:24:16.000+08:00",
      "slot": null,
      "slot_name": "2PM-4PM",
      "zone": null
    }
  ],
  "gogovan_orders": [],
  "delivery": {
    "id": 176,
    "start": null,
    "finish": null,
    "offer_id": 1947,
    "delivery_type": "Drop Off",
    "contact_id": null,
    "schedule_id": 4,
    "gogovan_order_id": null
  }
}

# docs.resources.deliveries.methods[].params[].params[].description
Id of offer to which delivery belongs.

# docs.resources.deliveries.methods[].params[].params[].description
Id of contact to which delivery belongs.

# docs.resources.deliveries.methods[].params[].params[].description
Id of schedule to which delivery belongs.

# docs.resources.deliveries.methods[].params[].params[].description
Delivery type.

# docs.resources.deliveries.methods[].params[].params[].validator
Must be one of: Alternate, Drop Off, Gogovan.

# docs.resources.deliveries.methods[].params[].params[].description
Not yet used

# docs.resources.deliveries.methods[].params[].params[].description
Not yet used

# docs.resources.deliveries.methods[].examples[]
// This is an example updating 'Drop Off Delivery'
PUT /api/v1/deliveries/181
{
  "delivery": {
    "offer_id": "1953",
    "contact_id": null,
    "schedule_id": "3",
    "delivery_type": "Drop Off",
    "start": null,
    "finish": null,
    "created_at": null,
    "updated_at": null,
    "gogovan_order_id": null,
    "deleted_at": null
  }
}
200
{
  "contacts": [],
  "schedules": [
    {
      "id": 3,
      "resource": null,
      "scheduled_at": "2015-02-20T15:24:17.000+08:00",
      "slot": null,
      "slot_name": "2PM-4PM",
      "zone": null
    }
  ],
  "gogovan_orders": [],
  "delivery": {
    "id": 181,
    "start": null,
    "finish": null,
    "offer_id": 1953,
    "delivery_type": "Drop Off",
    "contact_id": null,
    "schedule_id": 3,
    "gogovan_order_id": null
  }
}

# docs.resources.deliveries.methods[].apis[].short_description
Confirm Delivery with address, contact and schedule details

# docs.resources.deliveries.methods[].params[].params[].description
Id of Delivery

# docs.resources.deliveries.methods[].params[].params[].description
Delivery type.

# docs.resources.deliveries.methods[].params[].params[].validator
Must be one of: Gogovan, Drop Off, Alternate.

# docs.resources.deliveries.methods[].params[].params[].description
Id of Offer

# docs.resources.deliveries.methods[].params[].params[].params[].description
Date scheduled for delivery pick-up

# docs.resources.deliveries.methods[].params[].params[].params[].description
Time slot booked for delivery pick-up

# docs.resources.deliveries.methods[].params[].params[].params[].params[].validator
Must be one of: collection.

# docs.resources.deliveries.methods[].params[].params[].description
Time scheduled for delivery pick-up

# docs.resources.deliveries.methods[].params[].params[].description
Id of District

# docs.resources.deliveries.methods[].params[].params[].description
Id of gogovan transport option

# docs.resources.deliveries.methods[].params[].params[].description
Need english-speaking GGV Driver

# docs.resources.deliveries.methods[].params[].params[].description
Need carts

# docs.resources.deliveries.methods[].params[].params[].description
Id of Offer

# docs.resources.districts.short_description
Districts are sub-regions of Hong Kong territories

# docs.resources.districts.methods[].params[].description
Filter by district ids e.g. ids = [1,2,3,4]

# docs.resources.donor_conditions.short_description
Categorise the state a donation item is in. E.g. New / Used / Broken

# docs.resources.donor_conditions.methods[].params[].description
Filter by donor condition ids e.g. ids = [1,2,3,4]

# docs.resources.donor_conditions.methods[].examples[]
GET /api/v1/donor_conditions/39
200
{
  "donor_condition": {
    "id": 39,
    "name": "Heavily Used"
  }
}

# docs.resources.electricals.methods[].params[].params[].description
name of the brand

# docs.resources.electricals.methods[].params[].params[].description
model of the record

# docs.resources.electricals.methods[].params[].params[].description
serial number of the record

# docs.resources.electricals.methods[].params[].params[].description
size of the record

# docs.resources.electricals.methods[].params[].params[].description
cpu of the record

# docs.resources.electricals.methods[].params[].params[].description
ram of the record

# docs.resources.electricals.methods[].params[].params[].description
hdd of the record

# docs.resources.electricals.methods[].params[].params[].description
optical of the record

# docs.resources.electricals.methods[].params[].params[].description
video of the record

# docs.resources.electricals.methods[].params[].params[].description
sound of the record

# docs.resources.electricals.methods[].params[].params[].description
id of the user who updated the record

# docs.resources.gogovan_orders.methods[].params[].description
Scheduled time for delivery

# docs.resources.gogovan_orders.methods[].params[].description
Id of the district

# docs.resources.gogovan_orders.methods[].params[].description
Speak English?

# docs.resources.gogovan_orders.methods[].params[].validator
Must be one of: true, false.

# docs.resources.gogovan_orders.methods[].params[].description
Borrow Trolley(s)?

# docs.resources.gogovan_orders.methods[].params[].validator
Must be one of: true, false.

# docs.resources.gogovan_orders.methods[].params[].description
Porterage?

# docs.resources.gogovan_orders.methods[].params[].validator
Must be one of: true, false.

# docs.resources.gogovan_orders.methods[].params[].description
Id of the offer

# docs.resources.gogovan_orders.methods[].examples[]
POST /api/v1/gogovan_orders/calculate_price
{
  "pickupTime": "Wed Nov 26 2014 21:30:00 GMT+0530 (IST)",
  "districtId": "11",
  "needEnglish": "true",
  "needCart": "true",
  "needCarry": "true"
}
200
{
  "breakdown": {
    "fee": {
      "title": "Fee",
      "value": 120
    },
    "night_extra_charge": {
      "title": "Night Charge",
      "value": 100
    }
  },
  "base": 120
}

# docs.resources.goodcity_requests.methods[].params[].params[].description
requested quantity

# docs.resources.goodcity_requests.methods[].params[].params[].description
request description

# docs.resources.goodcity_settings.methods[].params[].params[].description
the config key

# docs.resources.goodcity_settings.methods[].params[].params[].description
the value

# docs.resources.goodcity_settings.methods[].params[].params[].description
a description of the configuration

# docs.resources.holidays.short_description
List next available dates (excluding holidays)

# docs.resources.holidays.methods[].params[].description
Number of next available days

# docs.resources.holidays.methods[].params[].description
Interval in number of days from when schedule start from current day

# docs.resources.holidays.methods[].params[].params[].description
Holiday date

# docs.resources.holidays.methods[].params[].params[].description
Name of holiday

# docs.resources.holidays.methods[].full_description
List all future holidays

# docs.resources.holidays.methods[].params[].params[].description
Holiday date

# docs.resources.holidays.methods[].params[].params[].description
Name of holiday

# docs.resources.identity_types.short_description
Identity types are the different kind of travel documents a user can have (hkid, asrf, ...)

# docs.resources.images.methods[].apis[].short_description
Use this method to get an authentication signature in order to upload an image to the Cloudinary service.

# docs.resources.images.methods[].full_description
This API server does not accept direct image uploads. Instead, they should be sent directly to the Cloudinary service. Please refer to the Cloudinary jQuery integration documentation for further information.

# docs.resources.images.methods[].params[].description
csv list of tags to identify image

# docs.resources.images.methods[].params[].params[].description
The cloudinary image id for the image

# docs.resources.images.methods[].params[].params[].description
This image will be used as default image for item

# docs.resources.images.methods[].params[].params[].validator
Must be one of: true, false, true, false.

# docs.resources.images.methods[].params[].params[].description
The offer item the image belongs to

# docs.resources.images.methods[].params[].params[].description
The cloudinary image id for the image

# docs.resources.images.methods[].params[].params[].description
This image will be used as default image for item

# docs.resources.images.methods[].params[].params[].validator
Must be one of: true, false, true, false.

# docs.resources.images.methods[].params[].params[].description
The offer item the image belongs to

# docs.resources.items.full_description
Item states¶ ↑

# docs.resources.items.methods[].params[].params[].description
Description/Details of item given by Item-Donor

# docs.resources.items.methods[].params[].params[].description
Describes the item's condition 1 - New; 2 - Lightly Used; 3 - Heavily Used; 4 - Broken; 5 - Mixed

# docs.resources.items.methods[].params[].params[].description
Fires the state transition (if allowed) for this item. 'submit' is for when the donor has completed creating the item and will change the state from draft to submitted. Items in draft state should be hidden from offer view and if donor clicks to add an item the draft item should be loaded allowing them to continue creating the item.

# docs.resources.items.methods[].params[].params[].validator
Must be one of: accept, reject, submit.

# docs.resources.items.methods[].params[].params[].description
Id of Offer to which item belongs.

# docs.resources.items.methods[].params[].params[].description
Not yet used

# docs.resources.items.methods[].params[].params[].description
A categorisation describing the reason the item was rejected 1 - Quality; 2 - Size; 3 - Supply/Demand

# docs.resources.items.methods[].params[].params[].description
Reviewer description of why the item was rejected

# docs.resources.items.methods[].params[].params[].description
Reviewer description of why the item was rejected given to Donor.

# docs.resources.items.methods[].examples[]
POST /api/v1/items
{
  "item": {
    "donor_description": "Est aperiam delectus quas officiis ea iure et voluptates.",
    "state": "submitted",
    "offer_id": "677",
    "package_type_id": "329",
    "rejection_reason_id": null,
    "reject_reason": null,
    "created_at": "2015-05-19 15:50:20 +0800",
    "updated_at": "2015-05-19 15:50:20 +0800",
    "saleable": false,
    "donor_condition_id": "257",
    "deleted_at": null,
    "rejection_comments": null
  }
}
201
{
  "packages": [],
  "images": [],
  "package_types": [
    {
      "id": 329,
      "name": "9gk9i",
      "code": "rmb",
      "other_child_packages": "",
      "default_child_packages": ""
    }
  ],
  "item": {
    "id": 223,
    "donor_description": "Est aperiam delectus quas officiis ea iure et voluptates.",
    "state": "draft",
    "offer_id": 677,
    "reject_reason": null,
    "saleable": false,
    "created_at": "2015-05-19T15:50:20.092+08:00",
    "updated_at": "2015-05-19T15:50:20.092+08:00",
    "package_type_id": 329,
    "rejection_comments": null,
    "donor_condition_id": 257,
    "rejection_reason_id": null,
    "message_ids": [],
    "package_ids": [],
    "image_ids": []
  }
}

# docs.resources.items.methods[].full_description
If this item's offer is in draft state it will be destroyed. Any other state and it will be marked as deleted but remain recoverable.

# docs.resources.items.methods[].params[].params[].description
Description/Details of item given by Item-Donor

# docs.resources.items.methods[].params[].params[].description
Describes the item's condition 1 - New; 2 - Lightly Used; 3 - Heavily Used; 4 - Broken; 5 - Mixed

# docs.resources.items.methods[].params[].params[].description
Fires the state transition (if allowed) for this item. 'submit' is for when the donor has completed creating the item and will change the state from draft to submitted. Items in draft state should be hidden from offer view and if donor clicks to add an item the draft item should be loaded allowing them to continue creating the item.

# docs.resources.items.methods[].params[].params[].validator
Must be one of: accept, reject, submit.

# docs.resources.items.methods[].params[].params[].description
Id of Offer to which item belongs.

# docs.resources.items.methods[].params[].params[].description
Not yet used

# docs.resources.items.methods[].params[].params[].description
A categorisation describing the reason the item was rejected 1 - Quality; 2 - Size; 3 - Supply/Demand

# docs.resources.items.methods[].params[].params[].description
Reviewer description of why the item was rejected

# docs.resources.items.methods[].params[].params[].description
Reviewer description of why the item was rejected given to Donor.

# docs.resources.locations.methods[].params[].description
Filter by location ids e.g. ids = [1,2,3,4]

# docs.resources.locations.methods[].params[].params[].description
Name of building

# docs.resources.locations.methods[].params[].params[].description
Name of area

# docs.resources.medicals.short_description
Create, update and show action to perform on Medical.

# docs.resources.medicals.methods[].params[].params[].description
Name of the brand

# docs.resources.medicals.methods[].params[].params[].description
Name of the model

# docs.resources.medicals.methods[].params[].params[].description
Serial number of the medical item

# docs.resources.medicals.methods[].params[].params[].description
Country ID

# docs.resources.medicals.methods[].params[].params[].validator
Must be one of: String, Integer.

# docs.resources.medicals.methods[].params[].params[].description
ID of user who updated the record

# docs.resources.medicals.methods[].params[].params[].validator
Must be one of: String, Integer.

# docs.resources.messages.short_description
List, show, create and mark_read a message.

# docs.resources.messages.methods[].params[].description
Filter by message ids e.g. ids = [1,2,3,4]

# docs.resources.messages.methods[].params[].description
Return messages for offer id.

# docs.resources.messages.methods[].params[].description
Message Type e.g. [public, private]

# docs.resources.messages.methods[].params[].validator
Must be one of: true, false.

# docs.resources.messages.methods[].params[].description
Return messages for item id.

# docs.resources.messages.methods[].params[].description
Return messages for order id

# docs.resources.messages.methods[].params[].description
Return messages for package id

# docs.resources.messages.methods[].params[].description
Specific user id to fetch the messages of

# docs.resources.messages.methods[].params[].description
Message state (unread|read) to filter on

# docs.resources.messages.methods[].examples[]
GET /api/v1/messages/177
200
{
  "user": [
    {
      "id": 1859,
      "first_name": "Deanna",
      "last_name": "Moore",
      "permission_id": null
    }
  ],
  "message": {
    "id": 177,
    "body": "Optio cupiditate reprehenderit sunt impedit. Atque suscipit sed maiores non facere id recusandae officia. Velit eius et veniam nisi iusto.",
    "state": "unread",
    "is_private": false,
    "created_at": "2014-12-03T11:56:55.413+08:00",
    "updated_at": "2014-12-03T11:56:55.413+08:00",
    "offer_id": 571,
    "item_id": 518,
    "sender_id": 1859
  }
}

# docs.resources.messages.methods[].params[].params[].description
Message body

# docs.resources.messages.methods[].params[].params[].description
Message sent by

# docs.resources.messages.methods[].params[].params[].description
Message Type e.g. [public, private]

# docs.resources.messages.methods[].params[].params[].validator
Must be one of: true, false.

# docs.resources.messages.methods[].params[].params[].description
Offer for which message has been posted

# docs.resources.messages.methods[].params[].params[].description
Item for which message has been posted

# docs.resources.messages.methods[].params[].params[].description
Current User's Subscription State e.g. unread, read

# docs.resources.messages.methods[].params[].params[].description
Order id on which message is created

# docs.resources.messages.methods[].params[].params[].description
Specific user id to subscribe the message to

# docs.resources.messages.methods[].examples[]
POST /api/v1/messages
{
  "message": {
    "body": "Aut sit porro aliquam veritatis. Voluptas non amet consequuntur consequatur tenetur et rem. Impedit minus veniam dolorem nam dicta tenetur. Delectus repellat expedita molestiae laudantium eveniet minima dolores. Aliquid perferendis at corrupti aperiam inventore sunt ullam.",
    "sender": "1863",
    "is_private": false,
    "state": "unread",
    "offer_id": "573"
  }
}
201
{
  "user": [
    {
      "id": 1863,
      "first_name": "Danika",
      "last_name": "Rogahn",
      "permission_id": null
    }
  ],
  "message": {
    "id": 179,
    "body": "Aut sit porro aliquam veritatis. Voluptas non amet consequuntur consequatur tenetur et rem. Impedit minus veniam dolorem nam dicta tenetur. Delectus repellat expedita molestiae laudantium eveniet minima dolores. Aliquid perferendis at corrupti aperiam inventore sunt ullam.",
    "state": "read",
    "is_private": false,
    "created_at": "2014-12-03T11:56:55.653+08:00",
    "updated_at": "2014-12-03T11:56:55.653+08:00",
    "offer_id": 573,
    "item_id": null,
    "sender_id": 1863
  }
}

# docs.resources.messages.methods[].examples[]
PUT /api/v1/messages/890/mark_read
{}
200
{
  "user": [
    {
      "id": 8913,
      "first_name": "Frederik",
      "last_name": "Prohaska",
      "mobile": "11111111",
      "address_id": 10774,
      "permission_id": null
    }
  ],
  "addresses": [
    {
      "id": 10774,
      "street": "MyString",
      "flat": "MyString",
      "building": "MyString",
      "district_id": null,
      "addressable_id": 8913,
      "addressable_type": "User"
    }
  ],
  "districts": [],
  "permissions": [],
  "message": {
    "id": 890,
    "body": "Quia repellat molestiae qui incidunt velit. Consequatur aut ea ipsam vero voluptas. Fugiat enim et numquam iste vel ut iusto.",
    "state": "read",
    "sender_id": 8913,
    "is_private": false,
    "created_at": "2014-10-10T12:49:19.876Z",
    "updated_at": "2014-10-10T12:49:19.876Z",
    "offer_id": 2752,
    "item_id": 3172
  }
}

# docs.resources.messages.methods[].params[].description
Return messages for messageable_type

# docs.resources.messages.methods[].params[].description
Return messages for messageable_id.

# docs.resources.messages.methods[].params[].description
Message Type e.g. [public, private]

# docs.resources.messages.methods[].params[].validator
Must be one of: true, false.

# docs.resources.messages.methods[].params[].description
Message state (unread|read) to filter on

# docs.resources.offers.full_description
Only offers that are visible to the current user are returned. Donors will only see their offers. Reviewers will see offers from all users.

Offer states¶ ↑

# docs.resources.offers.methods[].params[].params[].description
Offer language. If not set, defaults to API header language.

# docs.resources.offers.methods[].params[].params[].validator
Must be one of: en, zh-tw.

# docs.resources.offers.methods[].params[].params[].description
Fires the state transition (if allowed) for this offer.

# docs.resources.offers.methods[].params[].params[].validator
Must be one of: cancel, submit, reopen, start_review, finish_review, schedule, cancel_schedule, mark_unwanted, receive, start_receiving, re_review, mark_inactive.

# docs.resources.offers.methods[].params[].params[].description
Not yet used

# docs.resources.offers.methods[].params[].params[].description
Does offer collection involve using stairs?

# docs.resources.offers.methods[].params[].params[].validator
Must be one of: true, false.

# docs.resources.offers.methods[].params[].params[].description
Is parking provided?

# docs.resources.offers.methods[].params[].params[].validator
Must be one of: true, false.

# docs.resources.offers.methods[].params[].params[].description
How big is the item?

# docs.resources.offers.methods[].params[].params[].description
Not yet used

# docs.resources.offers.methods[].params[].params[].description
User id of reviewer who is looking at the offer. Can only be set by reviewers. It will be ignored otherwise.

# docs.resources.offers.methods[].params[].params[].description
The source district of the offer.

# docs.resources.offers.methods[].params[].params[].description
The method used to deliver the offer to Crossroads, to be populated when closing an offer

# docs.resources.offers.methods[].examples[]
POST /api/v1/offers
{
  "offer": {
    "language": "en",
    "origin": "web",
    "stairs": true,
    "parking": true,
    "estimated_size": "4",
    "notes": "Blanditiis recusandae aut dicta dolor velit. Ratione minus magnam sed aut. Architecto eos eos et accusamus amet. Et omnis animi aperiam placeat libero cum."
  }
}
201
{
  "items": [],
  "messages": [],
  "user": [
    {
      "id": 1870,
      "first_name": "Devyn",
      "last_name": "Windler",
      "permission_id": null
    }
  ],
  "deliveries": [],
  "offer": {
    "id": 577,
    "language": "en",
    "state": "draft",
    "origin": "web",
    "stairs": true,
    "parking": true,
    "estimated_size": "4",
    "notes": "Blanditiis recusandae aut dicta dolor velit. Ratione minus magnam sed aut. Architecto eos eos et accusamus amet. Et omnis animi aperiam placeat libero cum.",
    "created_by_id": 1870,
    "created_at": "2014-12-03T11:56:55.916+08:00",
    "updated_at": "2014-12-03T11:56:55.916+08:00",
    "submitted_at": null,
    "reviewed_at": null,
    "item_ids": [],
    "message_ids": [],
    "reviewed_by_id": null,
    "delivery_id": null
  }
}

# docs.resources.offers.methods[].params[].description
Filter by offer states. Note: you can also use the pseudo states 'not_active' or 'nondraft' which mean states=['received', 'closed', 'cancelled', 'inactive'] and states=['submitted', 'under_review', 'reviewed', 'scheduled', 'receiving'] respectively.

# docs.resources.offers.methods[].params[].validator
Must be an array of ["draft", "submitted", "under_review", "reviewed", "scheduled", "closed", "received", "cancelled", "receiving", "inactive", "active", "not_active", "nondraft", "for_donor", "donor_non_draft"]

# docs.resources.offers.methods[].params[].description
Return offers created by the given user id.

# docs.resources.offers.methods[].params[].description
Return offers reviewed by the given user id.

# docs.resources.offers.methods[].params[].description
If true, API response will not include messages.

# docs.resources.offers.methods[].params[].validator
Must be one of: true, false.

# docs.resources.offers.methods[].examples[]
GET /api/v1/offers
200
{
  "items": [],
  "messages": [],
  "user": [
    {
      "id": 1866,
      "first_name": "Vincenza",
      "last_name": "Schumm",
      "permission_id": null
    },
    {
      "id": 1867,
      "first_name": "Lavada",
      "last_name": "Leffler",
      "permission_id": null
    }
  ],
  "deliveries": [],
  "offers": [
    {
      "id": 574,
      "language": "en",
      "state": "draft",
      "origin": "web",
      "stairs": true,
      "parking": true,
      "estimated_size": "3",
      "notes": "Debitis animi possimus et id accusantium qui. Voluptatem voluptatibus repellendus nostrum et aliquam ad quisquam. Quis accusamus quas nostrum ducimus. Ipsa est consequatur ducimus non eos.",
      "created_by_id": 1866,
      "created_at": "2014-12-03T11:56:55.722+08:00",
      "updated_at": "2014-12-03T11:56:55.722+08:00",
      "submitted_at": null,
      "reviewed_at": null,
      "item_ids": [],
      "message_ids": [],
      "reviewed_by_id": null,
      "delivery_id": null
    },
    {
      "id": 575,
      "language": "en",
      "state": "draft",
      "origin": "web",
      "stairs": true,
      "parking": false,
      "estimated_size": "3",
      "notes": "Libero eaque nisi accusantium odio quidem. Est dignissimos itaque ex molestiae voluptas et. Quia nesciunt architecto rem explicabo error mollitia placeat sint. Ut sed sint doloremque totam est est.",
      "created_by_id": 1867,
      "created_at": "2014-12-03T11:56:55.745+08:00",
      "updated_at": "2014-12-03T11:56:55.745+08:00",
      "submitted_at": null,
      "reviewed_at": null,
      "item_ids": [],
      "message_ids": [],
      "reviewed_by_id": null,
      "delivery_id": null
    }
  ]
}

# docs.resources.offers.methods[].examples[]
GET /api/v1/offers/247
200
{
  "items": [],
  "messages": [],
  "user": [
    {
      "id": 769,
      "first_name": "Jules",
      "last_name": "Vandervort",
      "permission_id": null,
      "image_id": 817
    }
  ],
  "images": [
    {
      "id": 817,
      "favourite": false,
      "cloudinary_id": "1416902230/mmguhm3zdkonc2nynjue.jpg",
      "item_id": null
    }
  ],
  "deliveries": [],
  "gogovan_transports": [
    {
      "id": 23,
      "name": "5.5t Truck"
    }
  ],
  "crossroads_transports": [
    {
      "id": 23,
      "name": "6/8 Truck",
      "cost": 450
    }
  ],
  "offer": {
    "id": 247,
    "language": "en",
    "state": "draft",
    "origin": "web",
    "stairs": false,
    "parking": true,
    "estimated_size": "2",
    "notes": "Officia sapiente sunt ea dolorum sint blanditiis voluptates. Ut et omnis sed provident iure error molestiae. Alias quae magni id et odit vel. Voluptatem nemo possimus saepe voluptatem consequatur adipisci.",
    "created_by_id": 769,
    "created_at": "2015-01-23T22:24:25.454+08:00",
    "updated_at": "2015-01-23T22:24:25.454+08:00",
    "submitted_at": null,
    "reviewed_at": null,
    "gogovan_transport_id": 23,
    "crossroads_transport_id": 23,
    "item_ids": [],
    "message_ids": [],
    "reviewed_by_id": null,
    "delivery_id": null
  }
}

# docs.resources.offers.methods[].params[].params[].description
Offer language. If not set, defaults to API header language.

# docs.resources.offers.methods[].params[].params[].validator
Must be one of: en, zh-tw.

# docs.resources.offers.methods[].params[].params[].description
Fires the state transition (if allowed) for this offer.

# docs.resources.offers.methods[].params[].params[].validator
Must be one of: cancel, submit, reopen, start_review, finish_review, schedule, cancel_schedule, mark_unwanted, receive, start_receiving, re_review, mark_inactive.

# docs.resources.offers.methods[].params[].params[].description
Not yet used

# docs.resources.offers.methods[].params[].params[].description
Does offer collection involve using stairs?

# docs.resources.offers.methods[].params[].params[].validator
Must be one of: true, false.

# docs.resources.offers.methods[].params[].params[].description
Is parking provided?

# docs.resources.offers.methods[].params[].params[].validator
Must be one of: true, false.

# docs.resources.offers.methods[].params[].params[].description
How big is the item?

# docs.resources.offers.methods[].params[].params[].description
Not yet used

# docs.resources.offers.methods[].params[].params[].description
User id of reviewer who is looking at the offer. Can only be set by reviewers. It will be ignored otherwise.

# docs.resources.offers.methods[].params[].params[].description
The source district of the offer.

# docs.resources.offers.methods[].params[].params[].description
The method used to deliver the offer to Crossroads, to be populated when closing an offer

# docs.resources.offers.methods[].params[].description
Can these items be sold?

# docs.resources.offers.methods[].params[].validator
Must be one of: true, false.

# docs.resources.offers.methods[].examples[]
PUT /api/v1/offers/578
{
  "offer": {
    "language": "en",
    "origin": "web",
    "stairs": true,
    "parking": false,
    "estimated_size": "3",
    "notes": "Qui doloremque nemo aliquid voluptatem. Omnis tempore id officiis tempora voluptas labore veritatis vitae. Repellendus ab est aliquam architecto ut. Ipsum inventore quam similique ut error maiores tempore et.",
    "state_event": "submit",
    "saleable": true
  }
}
200
{
  "items": [],
  "messages": [],
  "user": [
    {
      "id": 1872,
      "first_name": "Victoria",
      "last_name": "Nolan",
      "permission_id": null
    }
  ],
  "deliveries": [],
  "offer": {
    "id": 578,
    "language": "en",
    "state": "submitted",
    "origin": "web",
    "stairs": true,
    "parking": false,
    "estimated_size": "3",
    "notes": "Qui doloremque nemo aliquid voluptatem. Omnis tempore id officiis tempora voluptas labore veritatis vitae. Repellendus ab est aliquam architecto ut. Ipsum inventore quam similique ut error maiores tempore et.",
    "created_by_id": 1872,
    "created_at": "2014-12-03T11:56:55.976+08:00",
    "updated_at": "2014-12-03T11:56:55.997+08:00",
    "submitted_at": "2014-12-03T11:56:55.997+08:00",
    "reviewed_at": null,
    "item_ids": [],
    "message_ids": [],
    "reviewed_by_id": null,
    "delivery_id": null
  }
}

# docs.resources.offers.methods[].full_description
If an offer is in draft state it will be destroyed. Any other state will be changed to 'cancelled'.

# docs.resources.offers.methods[].apis[].short_description
Assign current_user as Offer reviewer. If two or more reviewers start review at the same time, assign offer to the first reviewer and return offer with reviewer details to other reviewer(s)

# docs.resources.offers.methods[].examples[]
PUT /api/v1/offers/579/review
{}
200
{
  "items": [],
  "messages": [],
  "user": [
    {
      "id": 1875,
      "first_name": "Kathryn",
      "last_name": "Medhurst",
      "permission_id": null
    },
    {
      "id": 1874,
      "first_name": "Wallace",
      "last_name": "Murazik",
      "permission_id": 430
    }
  ],
  "deliveries": [],
  "offer": {
    "id": 579,
    "language": "en",
    "state": "under_review",
    "origin": "web",
    "stairs": false,
    "parking": true,
    "estimated_size": "2",
    "notes": "Delectus tenetur labore soluta qui quidem molestiae placeat. Nisi sunt cum tempora doloremque esse provident fuga quis. Magni omnis laboriosam quasi repellendus nemo et.",
    "created_by_id": 1875,
    "created_at": "2014-12-03T11:56:56.085+08:00",
    "updated_at": "2014-12-03T11:56:56.105+08:00",
    "submitted_at": null,
    "reviewed_at": "2014-12-03T11:56:56.105+08:00",
    "item_ids": [],
    "message_ids": [],
    "reviewed_by_id": 1874,
    "delivery_id": null
  }
}

# docs.resources.offers.methods[].params[].params[].description
State transition event ex: 'finish_review'

# docs.resources.offers.methods[].examples[]
PUT /api/v1/offers/349/complete_review
{
  "offer": {
    "state_event": "finish_review",
    "gogovan_transport_id": "385",
    "crossroads_transport_id": "415"
  }
}
200
{
  "items": [],
  "messages": [],
  "user": [
    {
      "id": 1108,
      "first_name": "Flavie",
      "last_name": "Rowe",
      "permission_id": null
    }
  ],
  "deliveries": [],
  "gogovan_transports": [
    {
      "id": 385,
      "name": "5.5t Truck"
    }
  ],
  "crossroads_transports": [
    {
      "id": 415,
      "name": "7/8 Truck"
    }
  ],
  "offer": {
    "id": 349,
    "language": "en",
    "state": "reviewed",
    "origin": "web",
    "stairs": true,
    "parking": true,
    "estimated_size": "4",
    "notes": "Velit consequatur est non enim. Suscipit totam atque molestias et est dolor unde. Eum molestiae quia ut dolores repudiandae cupiditate. Non vel dicta illo dolor quia praesentium aut.",
    "created_by_id": 1108,
    "created_at": "2014-12-23T19:12:51.913+08:00",
    "updated_at": "2014-12-23T19:12:52.052+08:00",
    "submitted_at": null,
    "reviewed_at": null,
    "gogovan_transport_id": 385,
    "crossroads_transport_id": 415,
    "item_ids": [],
    "message_ids": [],
    "reviewed_by_id": null,
    "delivery_id": null
  }
}

# docs.resources.offers.methods[].examples[]
PUT /api/v1/offers/774/close_offer
{}
200
{
  "items": [],
  "messages": [],
  "user": [
    {
      "id": 2382,
      "first_name": "Sedrick",
      "last_name": "Hodkiewicz",
      "permission_id": null,
      "image_id": 2526
    }
  ],
  "images": [
    {
      "id": 2526,
      "favourite": false,
      "cloudinary_id": "1416229451/jgpyo4oxrnfnjriofdjd.jpg",
      "item_id": null
    }
  ],
  "deliveries": [],
  "gogovan_transports": [],
  "crossroads_transports": [],
  "offer": {
    "id": 774,
    "language": "en",
    "state": "closed",
    "origin": "web",
    "stairs": true,
    "parking": true,
    "estimated_size": "1",
    "notes": "Expedita temporibus minus ut aut. Soluta quo commodi nostrum facere qui eius molestiae. Et quae quasi vel aliquam perferendis dolores voluptatem est.",
    "created_by_id": 2382,
    "created_at": "2015-01-28T15:21:43.788+08:00",
    "updated_at": "2015-01-28T15:21:43.913+08:00",
    "submitted_at": null,
    "reviewed_at": null,
    "gogovan_transport_id": null,
    "crossroads_transport_id": null,
    "crossroads_truck_cost": 0,
    "item_ids": [],
    "message_ids": [],
    "reviewed_by_id": null,
    "delivery_id": null
  }
}

# docs.resources.offers.methods[].apis[].short_description
Merges current offer into the base offer

# docs.resources.orders.short_description
Retrieve a list of designations, information about stock items that have been designated to a group or person.

# docs.resources.orders.methods[].params[].params[].description
Booking type.(Online order or appointment)

# docs.resources.orders.methods[].params[].params[].description
Notes for internal use

# docs.resources.orders.methods[].params[].params[].description
Booking type.(Online order or appointment)

# docs.resources.orders.methods[].params[].params[].description
Notes for internal use

# docs.resources.organisations.methods[].params[].params[].description
English name

# docs.resources.organisations.methods[].params[].params[].description
Chinese name

# docs.resources.organisations.methods[].params[].params[].description
English description of the organisation

# docs.resources.organisations.methods[].params[].params[].description
Chinese description of the organisation

# docs.resources.organisations.methods[].params[].params[].description
Type of organisation

# docs.resources.organisations.methods[].params[].params[].description
Website detail

# docs.resources.organisations.methods[].params[].params[].description
Registration detail

# docs.resources.organisations.methods[].params[].params[].description
Country identifier

# docs.resources.organisations.methods[].params[].params[].description
CRM Account Id

# docs.resources.organisations.methods[].params[].params[].description
English name

# docs.resources.organisations.methods[].params[].params[].description
Chinese name

# docs.resources.organisations.methods[].params[].params[].description
English description of the organisation

# docs.resources.organisations.methods[].params[].params[].description
Chinese description of the organisation

# docs.resources.organisations.methods[].params[].params[].description
Type of organisation

# docs.resources.organisations.methods[].params[].params[].description
Website detail

# docs.resources.organisations.methods[].params[].params[].description
Registration detail

# docs.resources.organisations.methods[].params[].params[].description
Country identifier

# docs.resources.organisations.methods[].params[].params[].description
CRM Account Id

# docs.resources.organisations.methods[].apis[].short_description
List all orders associated with organisation

# docs.resources.organisations_users.methods[].params[].params[].description
Id of organisation to which user belongs

# docs.resources.organisations_users.methods[].params[].params[].validator
Must be one of: Integer, String.

# docs.resources.organisations_users.methods[].params[].params[].description
Id of the user

# docs.resources.organisations_users.methods[].params[].params[].validator
Must be one of: Integer, String.

# docs.resources.organisations_users.methods[].params[].params[].description
Position of user in organisation

# docs.resources.organisations_users.methods[].params[].params[].description
Preferred contact number

# docs.resources.organisations_users.methods[].params[].params[].description
Approval status

# docs.resources.organisations_users.methods[].params[].params[].params[].description
First name of user

# docs.resources.organisations_users.methods[].params[].params[].params[].description
Family name of user

# docs.resources.organisations_users.methods[].params[].params[].params[].description
Mobile number of user

# docs.resources.organisations_users.methods[].params[].params[].params[].description
Email of user

# docs.resources.organisations_users.methods[].params[].params[].params[].description
Title of user

# docs.resources.organisations_users.methods[].params[].params[].description
Id of organisation to which user belongs

# docs.resources.organisations_users.methods[].params[].params[].validator
Must be one of: Integer, String.

# docs.resources.organisations_users.methods[].params[].params[].description
Id of the user

# docs.resources.organisations_users.methods[].params[].params[].validator
Must be one of: Integer, String.

# docs.resources.organisations_users.methods[].params[].params[].description
Position of user in organisation

# docs.resources.organisations_users.methods[].params[].params[].description
Preferred contact number

# docs.resources.organisations_users.methods[].params[].params[].description
Approval status

# docs.resources.organisations_users.methods[].params[].params[].params[].description
First name of user

# docs.resources.organisations_users.methods[].params[].params[].params[].description
Family name of user

# docs.resources.organisations_users.methods[].params[].params[].params[].description
Mobile number of user

# docs.resources.organisations_users.methods[].params[].params[].params[].description
Email of user

# docs.resources.organisations_users.methods[].params[].params[].params[].description
Title of user

# docs.resources.package_categories.methods[].examples[]
GET /api/v1/package_categories
200
{
  "package_categories": [
    {
      "id": 16,
      "name": "j5f0p",
      "parent_id": null,
      "package_type_codes": null
    },
    {
      "id": 17,
      "name": "hbqlh",
      "parent_id": 16,
      "package_type_codes": null
    },
    {
      "id": 18,
      "name": "ylanj",
      "parent_id": null,
      "package_type_codes": null
    },
    {
      "id": 19,
      "name": "l3jye",
      "parent_id": 18,
      "package_type_codes": null
    },
    {
      "id": 20,
      "name": "4vjo9",
      "parent_id": null,
      "package_type_codes": null
    },
    {
      "id": 21,
      "name": "teqq6",
      "parent_id": 20,
      "package_type_codes": null
    }
  ]
}

# docs.resources.package_sets.short_description
Get, create, update and delete package_sets.

# docs.resources.package_sets.methods[].params[].params[].description
Description/Details of the set

# docs.resources.package_sets.methods[].params[].params[].description
The type of packages contained in the set

# docs.resources.package_sets.methods[].params[].params[].description
Description/Details of the set

# docs.resources.package_sets.methods[].params[].params[].description
The type of packages contained in the set

# docs.resources.package_sets.methods[].full_description
The set's packages will have their package_set_id field nulled

# docs.resources.package_types.methods[].examples[]
GET /api/v1/package_types
200
{
  "package_types": [
    {
      "id": 590,
      "name": "mh9xs",
      "code": "dec",
      "other_child_packages": "dec",
      "default_child_packages": "dec"
    },
    {
      "id": 591,
      "name": "zcib3",
      "code": "ibe",
      "other_child_packages": "ibe",
      "default_child_packages": "ibe"
    },
    {
      "id": 592,
      "name": "w2rgd",
      "code": "uw0",
      "other_child_packages": "uw0",
      "default_child_packages": "uw0"
    }
  ]
}

# docs.resources.packages.methods[].examples[]
GET /api/v1/packages
200
{
  "packages": [
    {
      "id": 30,
      "quantity": 1,
      "length": 48,
      "width": 93,
      "height": 194,
      "notes": "Ducimus laudantium ipsum at voluptatem temporibus sunt. Aut molestias quidem ipsa aliquid nulla ad in ut. Aliquid velit qui occaecati quibusdam quasi sint.",
      "item_id": null,
      "state": null,
      "received_at": null,
      "rejected_at": null,
      "created_at": "2015-01-16T12:38:25.68793",
      "updated_at": "2015-01-16T12:38:25.68793",
      "package_type_id": 106
    },
    {
      "id": 31,
      "quantity": 1,
      "length": 163,
      "width": 97,
      "height": 41,
      "notes": "Optio officia ut dolor quis sunt quos qui. Et maiores in officiis tempore repellat odio id quia. Deleniti tempora nostrum molestiae ipsam perspiciatis nobis. Non modi quae quia et.",
      "item_id": null,
      "state": null,
      "received_at": null,
      "rejected_at": null,
      "created_at": "2015-01-16T12:38:25.699822",
      "updated_at": "2015-01-16T12:38:25.699822",
      "package_type_id": 107
    },
    {
      "id": 32,
      "quantity": 1,
      "length": 21,
      "width": 57,
      "height": 176,
      "notes": "Sunt quod quia delectus repudiandae. Error quia quasi nam quas ab. Illum nemo a ea molestiae sapiente minus voluptates incidunt.",
      "item_id": null,
      "state": null,
      "received_at": null,
      "rejected_at": null,
      "created_at": "2015-01-16T12:38:25.710279",
      "updated_at": "2015-01-16T12:38:25.710279",
      "package_type_id": 108
    }
  ]
}

# docs.resources.packages.methods[].examples[]
GET /api/v1/packages/33
200
{
  "package": {
    "id": 33,
    "quantity": 1,
    "length": 178,
    "width": 34,
    "height": 86,
    "notes": "Laudantium consequatur perferendis quia aut porro distinctio sequi. Autem ut voluptas quod velit ipsum. Repudiandae nobis sit itaque qui cupiditate aliquid perspiciatis. Dolore laborum commodi illum est qui asperiores est et. At sint vitae non officia non.",
    "item_id": 63,
    "state": null,
    "received_at": null,
    "rejected_at": null,
    "created_at": "2015-01-16T20:38:26.074+08:00",
    "updated_at": "2015-01-16T20:38:26.074+08:00",
    "package_type_id": 110
  }
}

# docs.resources.packages.methods[].params[].params[].description
Package quantity

# docs.resources.packages.methods[].params[].params[].description
Package quantity

# docs.resources.packages.methods[].params[].params[].description
Package length

# docs.resources.packages.methods[].params[].params[].description
Package width

# docs.resources.packages.methods[].params[].params[].description
Package height

# docs.resources.packages.methods[].params[].params[].description
Comment mentioned by customer

# docs.resources.packages.methods[].params[].params[].description
Item for which package is created

# docs.resources.packages.methods[].params[].params[].description
Fires the state transition (if allowed) for this package.

# docs.resources.packages.methods[].params[].params[].validator
Must be one of: mark_received, mark_missing.

# docs.resources.packages.methods[].params[].params[].description
Date on which package is received

# docs.resources.packages.methods[].params[].params[].description
Date on which package rejected

# docs.resources.packages.methods[].params[].params[].description
Category of the package

# docs.resources.packages.methods[].params[].params[].description
The id of the item image that represents this package

# docs.resources.packages.methods[].params[].params[].description
The id of donor-condition

# docs.resources.packages.methods[].params[].params[].description
Package max order quantity

# docs.resources.packages.methods[].examples[]
POST /api/v1/packages
{
  "package": {
    "quantity": 1,
    "length": 75,
    "width": 187,
    "height": 24,
    "notes": "Ea ullam facere ipsam dolorem omnis esse autem. Autem et animi saepe modi quia fugiat quas possimus. Culpa ipsam consequatur impedit at ut sit nobis maiores.",
    "received_at": null,
    "rejected_at": null,
    "item_id": "64",
    "package_type_id": "112"
  }
}
201
{
  "package": {
    "id": 34,
    "quantity": 1,
    "length": 75,
    "width": 187,
    "height": 24,
    "notes": "Ea ullam facere ipsam dolorem omnis esse autem. Autem et animi saepe modi quia fugiat quas possimus. Culpa ipsam consequatur impedit at ut sit nobis maiores.",
    "item_id": 64,
    "state": null,
    "received_at": null,
    "rejected_at": null,
    "created_at": "2015-01-16T20:38:26.325+08:00",
    "updated_at": "2015-01-16T20:38:26.325+08:00",
    "package_type_id": 112
  }
}

# docs.resources.packages.methods[].params[].params[].description
Package quantity

# docs.resources.packages.methods[].params[].params[].description
Package quantity

# docs.resources.packages.methods[].params[].params[].description
Package length

# docs.resources.packages.methods[].params[].params[].description
Package width

# docs.resources.packages.methods[].params[].params[].description
Package height

# docs.resources.packages.methods[].params[].params[].description
Comment mentioned by customer

# docs.resources.packages.methods[].params[].params[].description
Item for which package is created

# docs.resources.packages.methods[].params[].params[].description
Fires the state transition (if allowed) for this package.

# docs.resources.packages.methods[].params[].params[].validator
Must be one of: mark_received, mark_missing.

# docs.resources.packages.methods[].params[].params[].description
Date on which package is received

# docs.resources.packages.methods[].params[].params[].description
Date on which package rejected

# docs.resources.packages.methods[].params[].params[].description
Category of the package

# docs.resources.packages.methods[].params[].params[].description
The id of the item image that represents this package

# docs.resources.packages.methods[].params[].params[].description
The id of donor-condition

# docs.resources.packages.methods[].params[].params[].description
Package max order quantity

# docs.resources.packages.methods[].examples[]
PUT /api/v1/packages/35
{
  "package": {
    "quantity": 30,
    "length": 167,
    "width": 100,
    "height": 154,
    "notes": "Et voluptas libero eligendi occaecati pariatur veritatis unde. Dolorem beatae repudiandae modi error quis et. Possimus non cumque quia corrupti quaerat aut. Voluptatem perspiciatis et sit nostrum totam assumenda dolor. Consectetur tempore quibusdam vel alias doloremque temporibus.",
    "received_at": null,
    "rejected_at": null,
    "item_id": "65",
    "package_type_id": "115"
  }
}
200
{
  "package": {
    "id": 35,
    "quantity": 30,
    "length": 167,
    "width": 100,
    "height": 154,
    "notes": "Et voluptas libero eligendi occaecati pariatur veritatis unde. Dolorem beatae repudiandae modi error quis et. Possimus non cumque quia corrupti quaerat aut. Voluptatem perspiciatis et sit nostrum totam assumenda dolor. Consectetur tempore quibusdam vel alias doloremque temporibus.",
    "item_id": 65,
    "state": null,
    "received_at": null,
    "rejected_at": null,
    "created_at": "2015-01-16T20:38:26.574+08:00",
    "updated_at": "2015-01-16T20:38:26.603+08:00",
    "package_type_id": 115
  }
}

# docs.resources.packages.methods[].full_description
Deletion of the Package item in review mode

# docs.resources.packages.methods[].apis[].short_description
Get valuation of package based on its
           condition, grade and package type

# docs.resources.packages.methods[].params[].validator
Must be one of: Integer, String.

# docs.resources.packages.methods[].params[].validator
Must be one of: Integer, String.

# docs.resources.packages.methods[].apis[].short_description
Search packages (items for stock app) using inventory-number

# docs.resources.packages.methods[].apis[].short_description
Move a package's quantity to an new location

# docs.resources.packages.methods[].params[].description
Package quantity

# docs.resources.packages.methods[].params[].validator
Must be one of: Integer, String.

# docs.resources.packages.methods[].params[].description
Order involved in the package's designation

# docs.resources.packages.methods[].params[].validator
Must be one of: Integer, String.

# docs.resources.packages.methods[].params[].description
Location the package is moved to

# docs.resources.packages.methods[].params[].validator
Must be one of: Integer, String.

# docs.resources.packages.methods[].params[].description
Location the package is moved from

# docs.resources.packages.methods[].params[].validator
Must be one of: Integer, String.

# docs.resources.packages.methods[].params[].description
Location the package is moved from

# docs.resources.packages.methods[].params[].validator
Must be one of: Integer, String.

# docs.resources.packages.methods[].apis[].short_description
Designate a package's quantity to an order

# docs.resources.packages.methods[].params[].description
Package quantity

# docs.resources.packages.methods[].params[].validator
Must be one of: Integer, String.

# docs.resources.packages.methods[].params[].description
Order involved in the package's designation

# docs.resources.packages.methods[].params[].validator
Must be one of: Integer, String.

# docs.resources.packages.methods[].params[].description
Location the package is moved to

# docs.resources.packages.methods[].params[].validator
Must be one of: Integer, String.

# docs.resources.packages.methods[].params[].description
Location the package is moved from

# docs.resources.packages.methods[].params[].validator
Must be one of: Integer, String.

# docs.resources.packages.methods[].params[].description
Location the package is moved from

# docs.resources.packages.methods[].params[].validator
Must be one of: Integer, String.

# docs.resources.packages.methods[].params[].description
Package quantity

# docs.resources.packages.methods[].params[].validator
Must be one of: Integer, String.

# docs.resources.packages.methods[].params[].description
Order involved in the package's designation

# docs.resources.packages.methods[].params[].validator
Must be one of: Integer, String.

# docs.resources.packages.methods[].params[].description
Location the package is moved to

# docs.resources.packages.methods[].params[].validator
Must be one of: Integer, String.

# docs.resources.packages.methods[].params[].description
Location the package is moved from

# docs.resources.packages.methods[].params[].validator
Must be one of: Integer, String.

# docs.resources.packages.methods[].params[].description
Location the package is moved from

# docs.resources.packages.methods[].params[].validator
Must be one of: Integer, String.

# docs.resources.packages.methods[].apis[].short_description
Returns the packages nested inside of current package

# docs.resources.packages.methods[].apis[].short_description
Returns the packages which contain current package

# docs.resources.packages.methods[].apis[].short_description
List all versions associated with package

# docs.resources.processing_destinations.methods[].apis[].short_description
List all Processing Destination Lookups.

# docs.resources.requested_packages.methods[].apis[].short_description
Checkout and add all the packages to an order

# docs.resources.requested_packages.methods[].params[].validator
Must be one of: true, false, 1, 0.

# docs.resources.schedules.short_description
Schedule will help donors to plan their donation pick up.

# docs.resources.schedules.methods[].apis[].short_description
List of available schedules for current week

# docs.resources.schedules.methods[].params[].params[].description
Transport Type

# docs.resources.schedules.methods[].params[].params[].description
Time slot for the pick up e.g. slot 1 or slot2 etc

# docs.resources.schedules.methods[].params[].params[].description
Date and time of the pick up e.g Tuesday 23 October 2014, 10:30 am.

# docs.resources.schedules.methods[].params[].params[].description
Slot timing details e.g. Morning,11am-1pm or Afternoon,2pm-4pm etc

# docs.resources.schedules.methods[].params[].params[].description
zone for selection e.g. East, West, North etc

# docs.resources.stockit_activities.methods[].params[].params[].description
Name of Activity

# docs.resources.stockit_organisations.methods[].params[].params[].description
Name of organisation

# docs.resources.stocktakes.methods[].apis[].short_description
Processes a stocktake and tries to apply changes

# docs.resources.stocktakes.methods[].apis[].short_description
Deletes a stocktake and all its revisions

# docs.resources.territories.short_description
Hong Kong is divided into territories which is further subdivided into districts.

# docs.resources.twilio_inbound.full_description
Call from Donor is notified to Goodcity Staff who is subscribed to the Donor's recent Offer's private message thread.

Twilio will redirect it to the person who accepts the call. (Implemented using Twilio's Taskrouter feature.)

In case of any call-fallback, it will send airbreak notice.

# docs.resources.twilio_inbound.methods[].apis[].short_description
Called by Twilio when worker becomes Idle and Task is added to TaskQueue

# docs.resources.twilio_inbound.methods[].params[].description
Twilio Account SID

# docs.resources.twilio_inbound.methods[].params[].description
Twilio Workspace SID

# docs.resources.twilio_inbound.methods[].params[].description
Twilio Workflow SID

# docs.resources.twilio_inbound.methods[].params[].description
Twilio Task Reservation SID

# docs.resources.twilio_inbound.methods[].params[].description
Twilio Task Queue SID

# docs.resources.twilio_inbound.methods[].params[].description
Twilio current Task SID

# docs.resources.twilio_inbound.methods[].params[].description
Twilio worker SID

# docs.resources.twilio_inbound.methods[].params[].description
Serialized hash of following Task Attributes

param :caller, String, desc: 'Phone number of Caller(Donor)'

param :To, String, desc: 'phone number dialed by User(Donor)'

param :Called, String, desc: 'phone number dialed by User(Donor)'

param :direction, String, desc: 'inbound or outbound'

param :from, String, desc: 'Phone number of Caller(Donor)'

param :api_version, String, desc: 'Twilio API version'

param :call_sid, String, desc: 'SID of call'

param :user_id, Integer, desc: 'id of user(donor)'

param :selected_language, String, desc: 'ex: 'en''

param :call_status, String, desc: 'Status of call ex: ringing'

param :account_sid, String, desc: 'Twilio Account SID'

# docs.resources.twilio_inbound.methods[].params[].description
Serialized hash of following Worker Attributes

param :languages, Array, desc: “ex: [”en“]”

param :user_id, String, desc: “Id of User”

# docs.resources.twilio_inbound.methods[].apis[].short_description
This action will be called from twilio when call is completed

# docs.resources.twilio_inbound.methods[].full_description
Delete details related to current call from Redis

Update twilio-worker state from 'Idle' to 'Offline'

# docs.resources.twilio_inbound.methods[].params[].description
SID of call

# docs.resources.twilio_inbound.methods[].params[].description
Twilio Account SID

# docs.resources.twilio_inbound.methods[].params[].description
Twilio API version

# docs.resources.twilio_inbound.methods[].params[].description
inbound or outbound

# docs.resources.twilio_inbound.methods[].params[].description
phone number dialed by User(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
phone number dialed by User(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
Phone number of Caller(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
Phone number of Caller(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
Status of call ex: completed

# docs.resources.twilio_inbound.methods[].params[].description
Timestamp when call is completed

# docs.resources.twilio_inbound.methods[].params[].description
Time Duration of Call in seconds

# docs.resources.twilio_inbound.methods[].apis[].short_description
On runtime exception, invalid response or timeout at api request from Twilio to our application(at 'api/v1/twilio_inbound/voice')

# docs.resources.twilio_inbound.methods[].params[].description
SID of call

# docs.resources.twilio_inbound.methods[].params[].description
Twilio Account SID

# docs.resources.twilio_inbound.methods[].params[].description
Twilio API version

# docs.resources.twilio_inbound.methods[].params[].description
inbound or outbound

# docs.resources.twilio_inbound.methods[].params[].description
phone number dialed by User(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
phone number dialed by User(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
Phone number of Caller(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
Phone number of Caller(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
Url at which error is occured ex: 'api-staging.goodcity.hk/api/v1/twilio_inbound/voice'

# docs.resources.twilio_inbound.methods[].params[].description
Status of call ex: ringing

# docs.resources.twilio_inbound.methods[].params[].description
Code of error, ex: 11200

# docs.resources.twilio_inbound.methods[].examples[]
POST /api/v1/twilio_inbound/call_fallback
{
  "AccountSid": "f02e3c85572dc9ad7cb77c2a638e3be24",
  "Direction": "inbound",
  "ApiVersion": "2010-04-01",
  "CallSid": "CA7a9b9a9a6a113e45091c6482ebcf38b8",
  "From": "+85257362787",
  "Caller": "+85257362787",
  "To": "+163456799",
  "Called": "+163456799",
  "ErrorUrl": "http://api-staging.goodcity.hk/api/v1/twilio_inbound/voice",
  "CallStatus": "ringing",
  "ErrorCode": "11200"
}
200
<?xml version="1.0" encoding="UTF-8"?><Response><Say>Unfortunately there is some issue with connecting to Goodcity. Please try again after some time. Thank you.</Say><Hangup/></Response>

# docs.resources.twilio_inbound.methods[].apis[].short_description
Called by Twilio when Donor calls to Goodcity Voice Number.

# docs.resources.twilio_inbound.methods[].params[].description
SID of call

# docs.resources.twilio_inbound.methods[].params[].description
Twilio Account SID

# docs.resources.twilio_inbound.methods[].params[].description
Twilio API version

# docs.resources.twilio_inbound.methods[].params[].description
inbound or outbound

# docs.resources.twilio_inbound.methods[].params[].description
phone number dialed by User(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
phone number dialed by User(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
Phone number of Caller(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
Phone number of Caller(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
Status of call ex: ringing

# docs.resources.twilio_inbound.methods[].examples[]
// Inactive donor is calling to Goodcity
POST /api/v1/twilio_inbound/voice
{
  "AccountSid": "f02e3c85572dc9ad7cb77c2a638e3be24",
  "Direction": "inbound",
  "ApiVersion": "2010-04-01",
  "CallSid": "CA7a9b9a9a6a113e45091c6482ebcf38b8",
  "From": "+85265727331",
  "Caller": "+85265727331",
  "To": "+163456799",
  "Called": "+163456799",
  "CallStatus": "ringing"
}
200
<?xml version="1.0" encoding="UTF-8"?><Response><Dial><Number>+85229849309</Number></Dial></Response>

# docs.resources.twilio_inbound.methods[].examples[]
// Active donor is calling to Goodcity
POST /api/v1/twilio_inbound/voice
{
  "AccountSid": "f02e3c85572dc9ad7cb77c2a638e3be24",
  "Direction": "inbound",
  "ApiVersion": "2010-04-01",
  "CallSid": "CA7a9b9a9a6a113e45091c6482ebcf38b8",
  "From": "+85261607445",
  "Caller": "+85261607445",
  "To": "+163456799",
  "Called": "+163456799",
  "CallStatus": "ringing"
}
200
<?xml version="1.0" encoding="UTF-8"?><Response><Enqueue workflowSid="csdb5bea9nxcbxb0299c9668bvcc534" waitUrl="/api/v1/twilio_inbound/hold_donor" waitUrlMethod="post"><TaskAttributes>{"selected_language":"en","user_id":1840}</TaskAttributes></Enqueue><Gather numDigits="1" timeout="3" action="/api/v1/twilio_inbound/accept_callback"><Say>Unfortunately none of our staff are able to take your call at the moment.</Say><Say>You can request a call-back without leaving a message by pressing 1.</Say><Say>Otherwise, leave a message after the tone and our staff will get back to you as soon as possible. Thank you.</Say></Gather><Record maxLength="60" playBeep="true" action="/api/v1/twilio_inbound/send_voicemail"/></Response>

# docs.resources.twilio_inbound.methods[].examples[]
// Goodcity-Staff is calling to Goodcity
POST /api/v1/twilio_inbound/voice
{
  "AccountSid": "f02e3c85572dc9ad7cb77c2a638e3be24",
  "Direction": "inbound",
  "ApiVersion": "2010-04-01",
  "CallSid": "CA7a9b9a9a6a113e45091c6482ebcf38b8",
  "From": "+85252032446",
  "Caller": "+85255012565",
  "To": "+163456799",
  "Called": "+163456799"
}
200
<?xml version="1.0" encoding="UTF-8"?><Response><Say>Hello Sabrina Vandervort,</Say><Gather numDigits="5" action="/api/v1/twilio_inbound/accept_offer_id"><Say>Please input an offer ID and we will forward you to the donor's number.</Say></Gather><Say>Goodbye</Say><Hangup/></Response>

# docs.resources.twilio_inbound.methods[].apis[].short_description
Twilio Response to the caller waiting in queue

# docs.resources.twilio_inbound.methods[].params[].description
SID of call

# docs.resources.twilio_inbound.methods[].params[].description
Twilio Account SID

# docs.resources.twilio_inbound.methods[].params[].description
Twilio API version

# docs.resources.twilio_inbound.methods[].params[].description
inbound or outbound

# docs.resources.twilio_inbound.methods[].params[].description
phone number dialed by User(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
phone number dialed by User(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
Phone number of Caller(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
Phone number of Caller(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
Twilio API version

# docs.resources.twilio_inbound.methods[].params[].description
Status of call ex: ringing

# docs.resources.twilio_inbound.methods[].params[].description
Time spent by current caller in queue

# docs.resources.twilio_inbound.methods[].examples[]
// Donor waiting in queue for less than 30 seconds
POST /api/v1/twilio_inbound/hold_donor
{
  "AccountSid": "f02e3c85572dc9ad7cb77c2a638e3be24",
  "Direction": "inbound",
  "ApiVersion": "2010-04-01",
  "CallSid": "CA7a9b9a9a6a113e45091c6482ebcf38b8",
  "From": "+85250244487",
  "Caller": "+85250244487",
  "To": "+163456799",
  "Called": "+163456799",
  "QueueSid": "QU2f978538fcc71e13701f703a884ff392",
  "CallStatus": "ringing",
  "QueueTime": "0",
  "AvgQueueTime": "0",
  "QueuePosition": "1",
  "CurrentQueueSize": "1"
}
200
<?xml version="1.0" encoding="UTF-8"?><Response><Say>Hello Arnold Ortiz,</Say><Say>Thank you for calling GoodCity.HK, operated by Crossroads Foundation. Please wait a moment while we try to connect you to one of our staff.</Say><Play>http://test.host/api/v1/twilio_inbound/hold_music</Play></Response>

# docs.resources.twilio_inbound.methods[].examples[]
// Donor waiting in queue for more than 30 seconds
POST /api/v1/twilio_inbound/hold_donor
{
  "AccountSid": "f02e3c85572dc9ad7cb77c2a638e3be24",
  "Direction": "inbound",
  "ApiVersion": "2010-04-01",
  "CallSid": "CA7a9b9a9a6a113e45091c6482ebcf38b8",
  "From": "+85258518875",
  "Caller": "+85258518875",
  "To": "+163456799",
  "Called": "+163456799",
  "QueueSid": "QU2f978538fcc71e13701f703a884ff392",
  "CallStatus": "ringing",
  "QueueTime": "40",
  "AvgQueueTime": "0",
  "QueuePosition": "1",
  "CurrentQueueSize": "1"
}
200
<?xml version="1.0" encoding="UTF-8"?><Response><Leave/></Response>

# docs.resources.twilio_inbound.methods[].apis[].short_description
Twilio response sent when user press 1 key

# docs.resources.twilio_inbound.methods[].params[].description
SID of call

# docs.resources.twilio_inbound.methods[].params[].description
Twilio Account SID

# docs.resources.twilio_inbound.methods[].params[].description
Twilio API version

# docs.resources.twilio_inbound.methods[].params[].description
inbound or outbound

# docs.resources.twilio_inbound.methods[].params[].description
phone number dialed by User(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
phone number dialed by User(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
Phone number of Caller(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
Phone number of Caller(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
Status of call ex: in-progress

# docs.resources.twilio_inbound.methods[].params[].description
Digits entered by Caller

# docs.resources.twilio_inbound.methods[].examples[]
POST /api/v1/twilio_inbound/accept_callback
{
  "AccountSid": "f02e3c85572dc9ad7cb77c2a638e3be24",
  "Direction": "inbound",
  "ApiVersion": "2010-04-01",
  "CallSid": "CA7a9b9a9a6a113e45091c6482ebcf38b8",
  "From": "+85265128648",
  "Caller": "+85265128648",
  "To": "+163456799",
  "Called": "+163456799",
  "CallStatus": "in-progress",
  "Digits": "1",
  "msg": "Gather End"
}
200
<?xml version="1.0" encoding="UTF-8"?><Response><Say>Thank you, our staff will call you as soon as possible. Goodbye.</Say><Hangup/></Response>

# docs.resources.twilio_inbound.methods[].apis[].short_description
After voicemail, recording-Link sent to message thread and call is disconnected.

# docs.resources.twilio_inbound.methods[].params[].description
SID of call

# docs.resources.twilio_inbound.methods[].params[].description
Twilio Account SID

# docs.resources.twilio_inbound.methods[].params[].description
Twilio API version

# docs.resources.twilio_inbound.methods[].params[].description
inbound or outbound

# docs.resources.twilio_inbound.methods[].params[].description
phone number dialed by User(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
phone number dialed by User(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
Phone number of Caller(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
Phone number of Caller(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
Status of call ex: completed

# docs.resources.twilio_inbound.methods[].params[].description
Url of recording ex: api.twilio.com/2010-04-0Accounts/account_sid/Recordings/recording_sid

# docs.resources.twilio_inbound.methods[].params[].description
Recording Duration in seconds

# docs.resources.twilio_inbound.methods[].params[].description
SID of recording

# docs.resources.twilio_inbound.methods[].examples[]
POST /api/v1/twilio_inbound/send_voicemail
{
  "AccountSid": "f02e3c85572dc9ad7cb77c2a638e3be24",
  "Direction": "inbound",
  "ApiVersion": "2010-04-01",
  "CallSid": "CA7a9b9a9a6a113e45091c6482ebcf38b8",
  "From": "+85297173837",
  "Caller": "+85297173837",
  "To": "+163456799",
  "Called": "+163456799",
  "CallStatus": "completed",
  "RecordingUrl": "http://api.twilio.com/2010-04-01/Accounts/<account_sid>/Recordings/<recording_sid>",
  "Digits": "hangup",
  "RecordingDuration": "19",
  "RecordingSid": "<RecordingSid>"
}
200
<?xml version="1.0" encoding="UTF-8"?><Response><Say>Goodbye.</Say><Hangup/></Response>

# docs.resources.twilio_inbound.methods[].full_description
Set redis value: { “twilio_donor_<donor_id>” => <mobile> }

Update twilio-worker state from 'Offline' to 'Idle'

Send Call notification to Admin Staff.

# docs.resources.twilio_inbound.methods[].apis[].short_description
Returns mp3 file played for user while waiting in queue.

# docs.resources.twilio_inbound.methods[].apis[].short_description
Twilio response sent when input offer ID

# docs.resources.twilio_inbound.methods[].params[].description
SID of call

# docs.resources.twilio_inbound.methods[].params[].description
Twilio Account SID

# docs.resources.twilio_inbound.methods[].params[].description
Twilio API version

# docs.resources.twilio_inbound.methods[].params[].description
inbound or outbound

# docs.resources.twilio_inbound.methods[].params[].description
phone number dialed by User(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
phone number dialed by User(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
Phone number of Caller(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
Phone number of Caller(Donor)

# docs.resources.twilio_inbound.methods[].params[].description
Status of call ex: in-progress

# docs.resources.twilio_inbound.methods[].params[].description
Digits entered by Caller

# docs.resources.twilio_inbound.methods[].examples[]
POST /api/v1/twilio_inbound/accept_offer_id
{
  "AccountSid": "f02e3c85572dc9ad7cb77c2a638e3be24",
  "Direction": "inbound",
  "ApiVersion": "2010-04-01",
  "CallSid": "CA7a9b9a9a6a113e45091c6482ebcf38b8",
  "From": "+85262215703",
  "Caller": "+85268308220",
  "To": "+163456799",
  "Called": "+163456799",
  "CallStatus": "in-progress",
  "Digits": "750",
  "msg": "Gather End"
}
200
<?xml version="1.0" encoding="UTF-8"?><Response><Say>Connecting to Zack Hauck..</Say><Dial callerId="+163456799"><Number>+85268308220</Number></Dial></Response>

# docs.resources.twilio_outbound.full_description
Admin staff can call to Donor via Twilio.

If Donor is busy, not-answering or call-fails then it will play message to Admin.

After call completion it will add call-log message to Offer's Private Messaging thread.

Click for a Tech Diagram

# docs.resources.twilio_outbound.methods[].apis[].short_description
When an Admin calls       a donor from the application, Twilio will call this hook to determine what      it should do (who to call etc...)

# docs.resources.twilio_outbound.methods[].params[].description
Twilio Twiml Application SID

# docs.resources.twilio_outbound.methods[].params[].description
SID of call initialted by Admin

# docs.resources.twilio_outbound.methods[].params[].description
Twilio Account SID

# docs.resources.twilio_outbound.methods[].params[].description
Twilio API version

# docs.resources.twilio_outbound.methods[].params[].description
inbound or outbound

# docs.resources.twilio_outbound.methods[].params[].description
Name of the caller or phone number ex: 'client:Anonymous'

# docs.resources.twilio_outbound.methods[].params[].description
Name of the caller or phone number ex: 'client:Anonymous'

# docs.resources.twilio_outbound.methods[].params[].description
Status of Call ex: 'ringing'

# docs.resources.twilio_outbound.methods[].params[].description
Number to which call should be made. Here we are passing Combination of '<offer_id>#<caller_id>'

# docs.resources.twilio_outbound.methods[].examples[]
POST /api/v1/twilio_outbound/connect_call
{
  "AccountSid": "f02e3c85572dc9ad7cb77c2a638e3be24",
  "ApplicationSid": "cxcvxhv89fdbb0b0299c9668cdf9534",
  "Direction": "inbound",
  "ApiVersion": "2010-04-01",
  "Caller": "client:Anonymous",
  "CallSid": "CA7a9b9a9a6a113e45091c6482ebcf38b8",
  "From": "client:Anonymous",
  "CallStatus": "ringing",
  "phone_number": "9#148#+85251111111"
}
200
<?xml version="1.0" encoding="UTF-8"?><Response><Dial callerId="+163456799" action="/api/v1/twilio_outbound/completed_call"><Number>+85251111111</Number></Dial></Response>

# docs.resources.twilio_outbound.methods[].apis[].short_description
Outbound call from Admin to donor: Response sent to twilio when call fails, timeout or no response from Donor.

# docs.resources.twilio_outbound.methods[].params[].description
Twilio Twiml Application SID

# docs.resources.twilio_outbound.methods[].params[].description
SID of call initialted by Admin

# docs.resources.twilio_outbound.methods[].params[].description
Twilio Account SID

# docs.resources.twilio_outbound.methods[].params[].description
Twilio API version

# docs.resources.twilio_outbound.methods[].params[].description
inbound or outbound

# docs.resources.twilio_outbound.methods[].params[].description
Name of the caller or phone number ex: 'client:Anonymous'

# docs.resources.twilio_outbound.methods[].params[].description
Name of the caller or phone number ex: 'client:Anonymous'

# docs.resources.twilio_outbound.methods[].params[].description
Status of Call initialted by Admin (parent call)ex: 'in-progress'

# docs.resources.twilio_outbound.methods[].params[].description
SID of call between admin-donor

# docs.resources.twilio_outbound.methods[].params[].description
Status of Call between admin-donor (child call)ex: 'completed'

# docs.resources.twilio_outbound.methods[].params[].description
Admin-donor call duration in seconds (child-call)

# docs.resources.twilio_outbound.methods[].examples[]
// When call completed between Admin and Donor
POST /api/v1/twilio_outbound/completed_call
{
  "AccountSid": "f02e3c85572dc9ad7cb77c2a638e3be24",
  "ApplicationSid": "cxcvxhv89fdbb0b0299c9668cdf9534",
  "Direction": "inbound",
  "ApiVersion": "2010-04-01",
  "Caller": "client:Anonymous",
  "CallSid": "CA7a9b9a9a6a113e45091c6482ebcf38b8",
  "From": "client:Anonymous",
  "CallStatus": "in-progress",
  "DialCallSid": "CAf6de0c98d9d697b29ec60797f9e76ac2",
  "DialCallStatus": "completed",
  "DialCallDuration": "30"
}
200
<?xml version="1.0" encoding="UTF-8"?><Response><Hangup/></Response>

# docs.resources.twilio_outbound.methods[].examples[]
// When call to Donor is failed, not-answered or busy.
POST /api/v1/twilio_outbound/completed_call
{
  "AccountSid": "f02e3c85572dc9ad7cb77c2a638e3be24",
  "ApplicationSid": "cxcvxhv89fdbb0b0299c9668cdf9534",
  "Direction": "inbound",
  "ApiVersion": "2010-04-01",
  "Caller": "client:Anonymous",
  "CallSid": "CA7a9b9a9a6a113e45091c6482ebcf38b8",
  "From": "client:Anonymous",
  "CallStatus": "in-progress",
  "DialCallSid": "CAf6de0c98d9d697b29ec60797f9e76ac2",
  "DialCallStatus": "no-answer",
  "DialCallDuration": "30"
}
200
<?xml version="1.0" encoding="UTF-8"?><Response><Say>Couldn't reach Monserrat Boyle try again soon. Goodbye.</Say><Hangup/></Response>

# docs.resources.twilio_outbound.methods[].apis[].short_description
Called from Twilio when outbound call between Admin and Donor is completed.

# docs.resources.twilio_outbound.methods[].params[].description
Twilio Twiml Application SID

# docs.resources.twilio_outbound.methods[].params[].description
SID of call initialted by Admin

# docs.resources.twilio_outbound.methods[].params[].description
Twilio Account SID

# docs.resources.twilio_outbound.methods[].params[].description
Twilio API version

# docs.resources.twilio_outbound.methods[].params[].description
inbound or outbound

# docs.resources.twilio_outbound.methods[].params[].description
Name of the caller or phone number ex: 'client:Anonymous'

# docs.resources.twilio_outbound.methods[].params[].description
Name of the caller or phone number ex: 'client:Anonymous'

# docs.resources.twilio_outbound.methods[].params[].description
Status of Call ex: 'completed'

# docs.resources.twilio_outbound.methods[].params[].description
Call duration in seconds

# docs.resources.twilio_outbound.methods[].apis[].short_description
Generate Twilio Outgoing Call Capability Token. This allows clients to authenticate with Twilio and place calls etc.

# docs.resources.users.methods[].full_description
Note: in accordance with permissions, users will only be able to list users they are allowed to see. For a donor, this will be just themselves. For administrators, this will be all users.

# docs.resources.users.methods[].params[].description
Filter by user ids e.g. ids = [1,2,3,4]

# docs.resources.users.methods[].examples[]
GET /api/v1/users
200
{
  "users": [
    {
      "id": 23,
      "first_name": "Derick",
      "last_name": "Cronin",
      "permission_id": 12,
      "avatar_id": 23
    },
    {
      "id": 24,
      "first_name": "Kendall",
      "last_name": "Ziemann",
      "permission_id": null,
      "avatar_id": 24
    }
  ],
  "images": [
    {
      "id": 23,
      "favourite": false,
      "cloudinary_id": "1416817641/auyhxsvppoohnubhtdvp.jpg",
      "item_id": null
    },
    {
      "id": 24,
      "favourite": false,
      "cloudinary_id": "1416375331/zppxdm5fljlyv3tcfo3p.jpg",
      "item_id": null
    }
  ]
}

# docs.resources.users.methods[].full_description
Returns information about a user. Note image may be empty if user is not a reviewer.

# docs.resources.users.methods[].params[].params[].description
Time when user last connected to server.

# docs.resources.users.methods[].params[].params[].description
Time when user disconnected from server.

# docs.resources.users.methods[].apis[].short_description
Get mentionable users based on messageable context and roles

# docs.resources.users.methods[].params[].description
String of roles that needs to be mentioned

# docs.resources.users.methods[].params[].description
Type of messageable. Offer, Item, Package etc.

# docs.resources.users.methods[].params[].description
Id of any messageable type for Offer, Item, Package etc.

# docs.resources.users.methods[].apis[].short_description
Merge one user details into another user

# docs.resources.users.methods[].params[].description
Id of user in which other user will be merged

# docs.resources.users.methods[].params[].description
Id of user which needs to be merged and removed.

# docs.resources.users.methods[].apis[].short_description
Grant access to user using access-pass-key

# docs.resources.users.methods[].params[].description
AccessPass key to get access

# docs.resources.versions.short_description
List versions of items and related packages

# docs.resources.versions.methods[].apis[].short_description
List versions of items and related packages