I am trying to submit a transaction in block.io using PHP and curl, below is the endpoint:
$ curl https://block.io/api/v2/submit_transaction/?api_key=YOUR_API_KEY -d 'transaction_data=JSON_DATA_ABOVE' -H 'Content-Type: application/json'
Below is what I have done already:
$url = "https://block.io/api/v2/prepare_transaction/?api_key=e493-907e-eb6f-635c&from_addresses=2N6p8xNx47n8DqKCqbvMqXPbTttPT26T9BX&to_addresses=2N5p5Z7E5rXSKXdpAHJdd3jn1HFWkWjd1yJ&amounts=100";
$json = file_get_contents($url);
// API URL
$url = 'https://block.io/api/v2/submit_transaction/?api_key=b2e8-344f-65ae-ed0a';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
print_r($result);
And Below is the Error response I get
{ "status": "fail", "data": { "error_message": "Transaction data (transaction_data) must be a JSON object." } }
Please any help on how to get this done will be appreciated. Thanks.