Skip to content

[API] Fetch addresses

Dimitri Jorge edited this page Mar 25, 2014 · 1 revision

Note 1: In every API routes where :currency appears, it refers to the currency symbol. See this page for a list of all available currencies.

Note 2: In every API routes where :encrypted_email appears, it refers to the md5 of the email.

Get someone's address for a given currency

Route: GET /api/:currency/:encrypted_email/

Params: None

Returns the validated address that matches the currency and the encrypted_email or an error otherwise (400 or 404).

Example:

curl -X GET http://gravaco.in/api/ltc/458641ed4b2725b16edbf0192ca0b2f2/

Output:

Lgs5HMfXMMHZA8wsmYtLb5XF8uTPHpq9Sa

List all validated addresses

Route: GET /api/:encrypted_email

Params: None

Example:

curl -X GET http://gravaco.in/api/ltc/458641ed4b2725b16edbf0192ca0b2f2

Output:

[
  {
    "address": "Lgs5HMfXMMHZA8wsmYtLb5XF8uTPHpq9Sa",
    "currency": {
      "name": "Litecoin",
      "symbol": "ltc",
      "url": "http://litecoin.org"
    },
    "encrypted_email": "458641ed4b2725b16edbf0192ca0b2f2",
    "validated": true
  },
  {
    "address": "1W97yJxTfzYtYchzefxVPKqwoUb7Rx64M",
    "currency": {
      "name": "Bitcoin",
      "symbol": "btc",
      "url": "http://bitcoin.org"
    },
    "encrypted_email": "458641ed4b2725b16edbf0192ca0b2f2",
    "validated": true
  },
  {
    "address": "1W97yJxTfzYtYchzefxVPKqwoUb7Rx64M",
    "currency": {
      "name": "Dogecoin",
      "symbol": "doge",
      "url": "http://dogecoin.com"
    },
    "encrypted_email": "458641ed4b2725b16edbf0192ca0b2f2",
    "validated": true
  }
]

List all pending addresses

Route: GET /api/:encrypted_email/pending

Params: None

Example:

curl -X GET http://gravaco.in/api/458641ed4b2725b16edbf0192ca0b2f2/pending

Output:

[
  {
    "encrypted_email": "458641ed4b2725b16edbf0192ca0b2f2",
    "address": "1W97yJxTdwadwdawzefxVPKqwoUb7Rx64M",
    "currency": {
      "name": "Mincoin",
      "symbol": "mnc",
      "url": "http:///mincoin.io"
    },
    "validated": false
  }
]

Clone this wiki locally