Skip to content

3. Contacts

lockys edited this page Jun 27, 2016 · 22 revisions

GET /api/v2/accounts/{user-uuid}/contacts

  • 用途: 取得聯絡人
  • header:
    • apiKey(必要的)- API 鑰匙
  • parameter:
    • ?filter=like 回傳常用聯絡人
    • ?conditional=true 僅回傳自上次取得通訊錄時之後有更新的通訊錄。
  • response:
 [
  {
    "id": "contact-id"
    "userName": "詹姆士龐德",
    "phoneNumber": "+886911234567",
    "location": null,
    "profile": "我寫程式碼",
    "company": null,
    "jobTitle": "Developer",
    "email": "test@gmail.com",
    "profilePhotoId": null,
    "nickName": "老詹",
    "chargeType": 1,
    "availableStartTime": "0:19",
    "availableEndTime": "15:20",
    "isEnable": true,
    "isHigherPriorityThanGlobal": false,
    "providerAvailableStartTime": "00:00",
    "providerAvailableEndTime": "00:00",
    "providerIsEnable": true,
    "qrCodeUuid": "c180f329-1825-43e2-9dd7-543facb0461a",
    "customerIcon": null
  }
]

POST /api/v1/accounts/{user-uuid}/contacts/{qrCodeUuid}

  • 用途: 新增一筆聯絡人
  • header:
    • apiKey(required)
  • payload:
    {
      "nickName": "nf Haung",
      "chargeType": 0 | number greater than 0, // icon|free and charge
      "availableStartTime": "",
      "availableEndTime": "",
      "isEnable": true | false,
    }
  • parameter:
  • response:
    • status:
      • 201 Created
      • 304 Not Modified (以加 Provider 為聯絡人)
    {}

PUT /api/v2/accounts/{contact-id}/contacts

  • 用途: 修改某聯絡人資料(包含可通話時段)
  • header:
    • apiKey(required)
  • payload:
 {}
  • parameter:
    • nickName to update nickname
    • isEnable to update isEnable of a contact
    • availableStartTime to update availableStartTime of a contact
    • availableEndTime to update availableEndTime of a contact
    • isHigherPriorityThanGlobal to update isHigherPriorityThanGlobal, true means contact available time is be used.
  • response:
    • status:
      • 200 OK
    {}

DELETE /api/v2/accounts/{contact-id}/contacts

  • 用途: 刪除某筆聯絡人
  • header:
    • apiKey(required)
  • payload:
    {}
  • parameter:
  • response:
    • status:
      • 200 OK
    {}

POST /api/v1/accounts/{user-uuid}/calls/{qrCodeUuid}

This api is very buggy, plz use v2

  • 用途: 打電話給對方
  • header:
    • apiKey(required)
  • payload:
    {
      "caller": "+886932456212",
      "callee": "+886944422233"
    }
  • parameter:
  • response:
  • status
  • 200
  • 304 Restrict.
    {}

POST /api/v2/accounts/{user-uuid}/calls/

  • 用途: 打電話給對方
  • header:
    • apiKey(required)
  • payload:
    {
     "contactId":"ididid"
    }
  • parameter:
  • response:
  • status
  • 201 created
  • 400 bad request
  • 403 Forbidden
  • 404 Not found.
    {}

POST /api/v2/accounts/{uuid}/ping/{contactId}

  • 用途: 傳送簡短訊息
  • Payload
{
 "content": 我想和您聯絡。
}
  • response:
  • 200 OK

Clone this wiki locally