NAV
PHP

Introduction

Welcome to the Grussdich API! You can use our API to access Grussdich API endpoints, which can get information on wallet balance, exchange rates, etc in our database.

We have language bindings in PHP! You can view code examples in the dark area to the right.

Authentication

To authorize, use this code:

# With shell, you can just pass the correct header with each request
curl "api_endpoint_here"
-H "Authorization: grussdichgrussdich"

Make sure to replace grussdichgrussdich with your API key.

For Authentication and Authorization, you need an API Key.

To generate your personal API Key,
1.Login as user.
2.Go to Settings->Generate API Key.
3.Click on Create New Token and give a name for token.
4.Then, click on create.
4.An API Key will be generated.

Grussdich expects for the API key to be included in all API requests to the server in a header that looks like the following:

Authorization: grussdichgrussdich

Grussdich API

Wallet Balance

This endpoint retrieves wallet balance.

Grussdich has two wallets namely Fiat and crypto.

In Fiat Wallet, it retrieves the balance for wallets such as,
USD Wallet,
GBP Wallet,
CFA Wallet,
GHS Wallet etc.,

In Crypto Wallet, it retrieves the balance for wallets such as,
BTC Wallet,
LTC Wallet,
DOGE Wallet

HTTP Request

GET https://grussdich.com/api/wallet

URL Parameters

No parameters required.

curl "https://grussdich.com/api/wallet"
-H "Authorization: grussdichgrussdich"

The above command returns JSON structured like this:

[
{
"data": {
"fiat": [
{
"walletPaymentgatewayId": 2,
"walletCurrencyId": 4,
"walletName": "USD Wallet",
"walletLogo": "https://grussdich.com/uploads/currencies/icon_usd.png",
"accountNo": "U-USD-10006",
"availableBalance": "USD 0",
"pendingBalance": 0,
"lastAction": ""
},
],
"crypto": {
"btc": {
"imagePath": "https://grussdich.com/uploads/currencies/icon_btc.png",
"Name": "BTC",
"address": null,
"balance": "0 BTC ≈ 0.00 USD"
},


}
}
}
]

Send Coin

This endpoint retrieves the details of the coin sent.

The details of the coin sent are,
Amount - Amount with currency.
To Address - The address to which the amount is sent.
Date - Date on which the amount is sent.
Transaction Hash ID.

HTTP Request

GET https://grussdich.com/api/transaction/sendcoin

URL Parameters

No Parameters required.

curl "https://grussdich.com/api/transaction/sendcoin"
-H "Authorization: grussdichgrussdich"

The above command returns JSON structured like this:

{
"data": [
{
"amount": "0.00010 BTC",
"toAddress": "2MuV4JGRzgXXpFUjtpzeQF16WfKuiUumpZ3",
"date": "11/05/2018 12:52:46",
"transactionHashID": "5010adee94bbdee0ce1d0d0052272fbe22f4aa5b82279c81f3cb4796d48785ce"
}
]
}

Exchange Rates

This endpoint retrieves the exchange rates of the currencies.

HTTP Request

GET https://grussdich.com/api/getpairdetails

URL Parameters

Parameter Value Description
token BTC,LTC,DOGE or ETH The token of the currency to retrieve

Example

If the token is BTC, it retrieves the currency pair related to BTC such as,
BTC-USD
BTC-GBP
BTC-XOF
BTC-GHS etc.,

If the token is LTC, it retrieves the currency pair related to LTC such as,
LTC-USD
LTC-GBP
LTC-XOF
LTC-GHS etc.,

curl "https://grussdich.com/api/getpairdetails"
-H "Authorization: grussdichgrussdich"

The above command returns JSON structured like this:

[
{
"from_currency_token": "BTC",
"amount": "0.00",
"to_currency_token": "$",
"final_total": 0,
"final_total_per": 0,
"graph_values": [
0
]
},

{
"from_currency_token": "BTC",
"amount": "0.00",
"to_currency_token": "gh₵",
"final_total": 0,
"final_total_per": 0,
"graph_values": [
0,
0,
0,
0,
0,
0,
0
]
}
]

Errors

The Grussdich API uses the following error codes:

Error Code Meaning
400 Bad Request – Your request sucks
401 Unauthorized – Your API key is wrong
403 Forbidden – The kitten requested is hidden for administrators only
404 Not Found – The specified kitten could not be found
405 Method Not Allowed – You tried to access a kitten with an invalid method
500 Internal Server Error – We had a problem with our server. Try again later.
503 Service Unavailable – We’re temporarially offline for maintanance. Please try again later.
PHP