Skip to content

Latest commit

 

History

History
100 lines (77 loc) · 2.06 KB

_contacts.md

File metadata and controls

100 lines (77 loc) · 2.06 KB

Contacts

List Contacts

curl "https://api.bitreserve.org/v0/me/contacts" \
  -H "Authorization: Bearer <token>"

The above command returns the following JSON:

[
  {
    "id": "9fae84eb-712d-4b6a-9b2c-764bdde4c079",
    "firstName": "Han",
    "lastName": "Solo",
    "company": "Rebel Alliance",
    "emails": [
      "[email protected]"
    ],
    "addresses": [],
    "name": "Han Solo"
  },
  {
    "id": "2f3b26bf-4621-4fe9-ab7d-565105b22588",
    "firstName": "Leia",
    "lastName": "Organa",
    "company": "Galactic Senate",
    "emails": [
      "[email protected]"
    ],
    "addresses": [],
    "name": "Leia Organa"
  }
]

Request

GET https://api.bitreserve.org/v0/me/contacts

Response

Returns an array of contact objects associated with the current user.

Get Contact

curl "https://api.bitreserve.org/v0/me/contacts/9fae84eb-712d-4b6a-9b2c-764bdde4c079" \
  -H "Authorization: Bearer <token>"

The above command returns the following JSON:

{
  "id": "9fae84eb-712d-4b6a-9b2c-764bdde4c079",
  "firstName": "Han",
  "lastName": "Solo",
  "company": "Rebel Alliance",
  "emails": [
    "[email protected]"
  ],
  "addresses": [],
  "name": "Han Solo"
}

Request

GET https://api.bitreserve.org/v0/me/contacts/:id

Response

Returns an associative array containing the details of the designated contact.

Create Contact

curl -X POST --data "firstName=Luke&lastName=Skywalker&company=Lars+Moisture+Farm,+Inc.&[email protected]" \
  -H "Authorization: Bearer <token>" \
  https://api.bitreserve.org/v0/me/contacts

Request

POST https://api.bitreserve.org/v0/me/contacts

Parameter Default Description
firstName Contact's first name. (max: 255 chars)
lastName Contact's last name. (max: 255 chars)
company Contact's company. (max: 255 chars)
emails List of email addresses.
addresses List of bitcoin addresses.

Response

A fully formed Contact Object