changeangel API Docs

Documentation for changeangel.io crypto to crypto exchange.

Generate API Key

Signup and confirm email account to generate API Key API Authorisation is required on all API Calls

GET

Headers Description
API API Validation call using Headers API

Example

<?php
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, 'https://api.changeangel.io/api/validateApi');
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
	$headers = array();
	$headers[] = 'API: 3d1bc5-333886-a62c04-46ab3a-bd08bc';
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
	$result = curl_exec($ch);
	curl_close($ch);
	echo $result; //View cURL Output
?>
											

Response

{
    "success": true,
    "message": "Valid Authorisation Key"
}

Get all Currencies

Return list with all supported currencies

GET

Headers Description
API API Validation call using Headers API

PHP (using cURL)

<?php
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, 'https://api.changeangel.io/api/getCurrency');
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
	$headers = array();
	$headers[] = 'API: 3d1bc5-333886-a62c04-46ab3a-bd08bc';
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
	$result = curl_exec($ch);
	curl_close($ch);
	echo $result; //View cURL Output
?>

Response

[{
	"name": "Bitcoin",
	"short": "BTC",
	"svg": "https://changeangel.io/images/crypto-icons/svg/btc.svg",
	"png": "https://changeangel.io/images/crypto-icons/png/btc.png"
}, {
	"name": "DigiByte",
	"short": "DGB",
	"svg": "https://changeangel.io/images/crypto-icons/svg/dgb.svg",
	"png": "https://changeangel.io/images/crypto-icons/png/dgb.png"
}]
								

Get Estimated Exchange Amount

Return estimated exchange amount. API header is required.

POST getRates

Parameter Description
currency_from symbol of input currency
currency_to symbol of output currency
amount amount to exchange

Note

  1. If success is false. Error Message will be printed in error object
  2. sid is required while checking minimum and placing order to choose the best rates. We recommend to save sid and send it via parameter when required.
  3. Possible Error Messages:
    1. PAIR1 - PAIR2 not Available
    2. Invalid Amount Entered
    3. Deposit too Small

PHP (using cURL)

<?php
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, 'https://api.changeangel.io/api/getRates?currency_from=BTC&currency_to=DGB&amount=0.1');
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
	$headers = array();
	$headers[] = 'API: 3d1bc5-333886-a62c04-46ab3a-bd08bc';
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
	$result = curl_exec($ch);
	curl_close($ch);
	echo $result; //View cURL Output
?>

Response

{
	"success": true,
	"amount": "118038.36875000",
	"sid": "3"
}
								

Get Min/Max exchange amount

Return minimum and maximum (if exists) amount for exchange between selected currencies. API header is required.

POST getMinMax

Parameter Description
currency_from symbol of input currency
currency_to symbol of output currency

Note

  1. If success is false. Error Message will be printed in error object
  2. Possible Error Messages:
    1. PAIR1 - PAIR2 not Available

PHP (using cURL)

<?php
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, 'https://api.changeangel.io/api/getMinMax?currency_from=DGB&currency_to=BTC&sid=3');
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
	$headers = array();
	$headers[] = 'API: 3d1bc5-333886-a62c04-46ab3a-bd08bc';
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
	$result = curl_exec($ch);
	curl_close($ch);
	echo $result; //View cURL Output
?>

Response

{
	"success": true,
	"min": "1000.00000000",
	"max": "5000000.00000000"
}
								

Get Address Validation

Return boolean values for address validation. API header is required.

POST getAddress

Parameter Description
currency symbol of currency
address wallet address

Note

  • If success is true Address is valid.
  • If success is false Address is invalid.

PHP (using cURL)

<?php
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, 'https://api.changeangel.io/api/getAddress?currency=DGB&address=DDGcfHFCB4hiud5UZ66adCVjk3eJdBhyUi');
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
	$headers = array();
	$headers[] = 'API: 3d1bc5-333886-a62c04-46ab3a-bd08bc';
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
	$result = curl_exec($ch);
	curl_close($ch);
	echo $result; //View cURL Output
?>

Response

{
	"success": true
}
								

Get Transaction

Return Single Transaction Status. API header is required.

POST getTransaction

Parameter Description
txn Transaction ID

Note

  • If success is true transaction ID is valid.
  • If success is false transaction ID is invalid.
  • amount_from shows value created during API Call.
  • amount_received shows value originally what user sent.

PHP (using cURL)

<?php
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, 'https://api.changeangel.io/api/getTransaction?txn=2008arf3asuy12397');
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
	$headers = array();
	$headers[] = 'API: 3d1bc5-333886-a62c04-46ab3a-bd08bc';
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
	$result = curl_exec($ch);
	curl_close($ch);
	echo $result; //View cURL Output
?>

Response

{
	"success":true,
	"errorMessage":"",
	"txn": "2008arf3asuy12397",
	"status": "finished",
	"currency_from":"DGB",
	"currenct_to":"BTC",
	"amount_from": "100000",
	"amount_to": "11.72132433",
	"amount_received": "100000",
	"amount_sent": "11.731",
	"fees": "350",
	"created_at": "1565968314",
	"deposit_confirmed": "1565968766",
	"money_sent": "1565969173",
	"payinHash": "2f5a7808649bf2f4f0bd080ae6d9cfddb721305218f3ac3186fabc19c1d33a6f",
	"payoutHash": "c5c6d12cae8cf53d48e8b7b24f786406fa979a7158006e6cd55545f1f830f05a"
}
								

Get All Transactions

Return Last 50 Transactions. API header is required.

POST getTransactions

Parameter Description
txn Transaction ID (optional)

Note

  • txn parameter will return single transaction response.

PHP (using cURL)

<?php
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, 'https://api.changeangel.io/api/getTransactions');
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
	$headers = array();
	$headers[] = 'API: 3d1bc5-333886-a62c04-46ab3a-bd08bc';
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
	$result = curl_exec($ch);
	curl_close($ch);
	echo $result; //View cURL Output
?>

Response

[{
	"success":true,
	"errorMessage":"",
	"txn": "2008arf3asuy12397",
	"status": "finished",
	-
	-
	"payoutHash": "c5c6d12cae8cf53d48e8b7b24f786406fa979a7158006e6cd55545f1f830f05a"
},
{
	"success":true,
	"errorMessage":"",
	"txn": "2008arf3asuy123ah",
	"status": "finished",
	-
	-
	"payoutHash": "c5c6d12cae8cf53d48e8b7b24f786406fa979a7158006e6cd55545f1f830f05a"
}]
								

Create Swap

Create Exchange. API header is required.

POST createOrder

Parameter Description
currency_from symbol of input currency
currency_to symbol of output currency
amount amount to exchange
receiving_address wallet address of user to recieve crypto
refund_address refund address of user incase if any error occured
sid sid is obtained during getRates call.

Response Details

  • payin shows address where user have to deposit

PHP (using cURL)

<?php
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, 'https://api.changeangel.io/api/createOrder?currency_from=BTC&currency_to=DGB&amount=0.1&receiving_address=1MgJ3NRH1G7fiESttrtfXFBeUNd2h4kvqL&refund_address=DDGcfHFCB4hiud5UZ66adCVjk3eJdBhyUi&sid=3');
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
	$headers = array();
	$headers[] = 'API: 3d1bc5-333886-a62c04-46ab3a-bd08bc';
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
	$result = curl_exec($ch);
	curl_close($ch);
	echo $result; //View cURL Output
?>

Response

{
	"txn": "2008arf3asuy12397",
	"payin": "3Jd8pnhNDpKCRDfc2BtbGXR28nbyoNwnwa",
	"send": "0.1 BTC",
	"receive": "118038.36875000 DGB",
	"receive_address": "1MgJ3NRH1G7fiESttrtfXFBeUNd2h4kvqL"
}