Title: Payments through instawallet API Post by: Bart on May 02, 2012, 01:15:07 AM Quote HTTP POST https://www.instawallet.org/api/v1/w/<wallet_id>/payment (https://www.instawallet.org/api/v1/w/<wallet_id>/payment) Initiates a payment. Your request needs to include the parameters "address" and "amount". Amount should be in Bitcoin base units (Satoshis). The optional parameter "use_green_address" can be passed with a value of "true" to use the green address feature. Example response: {"successful": true, "message": "Sent 0.01 BTC to 14Z1mazY4HfysZyMaKudFr63EwHqQT2njz", "message_code": 0} https://www.instawallet.org/static/api.html I did not understand where and how I insert the parameters "address and "amount". An example: In this instawallet (naturally empty) https://www.instawallet.org/w/3rvuZQWvVnl5wvxoXARWMsKja3ooB3A the wallet_id is 3rvuZQWvVnl5wvxoXARWMsKja3ooB3A, not 1Goezou3Z18nimVobARq6pNo4noLxgBsuN, which is the address to send bitcoins to this wallet. Using API in this wallet: https://www.instawallet.org/api/v1/w/3rvuZQWvVnl5wvxoXARWMsKja3ooB3A/address (bitcoins address: 1Goezou3Z18nimVobARq6pNo4noLxgBsuN) ok https://www.instawallet.org/api/v1/w/3rvuZQWvVnl5wvxoXARWMsKja3ooB3A/balance (balance = 0.0 bitcoins) ok Let's say this instawallet is not empty and I want to send 0.1 bitcoin to the instawallet RXDS0myl8EFyDO2N8prYm8gAiTMUrJvtQ, which the address to receive bitcoins is: 17vuGAioA6Bah5HEznEFmNuzfSDQyiNt4t So, through API, would be: https://www.instawallet.org/api/v1/w/3rvuZQWvVnl5wvxoXARWMsKja3ooB3A/payment (https://www.instawallet.org/api/v1/w/3rvuZQWvVnl5wvxoXARWMsKja3ooB3A/payment) ???????????? Where do I insert the parameters 17vuGAioA6Bah5HEznEFmNuzfSDQyiNt4t+0.1 into this url? And if you want to use green address, how to do that? Title: Re: Payments through instawallet API Post by: Tuxavant on May 02, 2012, 02:54:11 AM A post requires the information to be in the HTML header, not the query string. Use a tool like curl to add the address and amount fields to the header.
Code: -d, --data <data> Title: Re: Payments through instawallet API Post by: andrehorta on May 17, 2012, 06:20:11 PM Hi
When ai call: https://www.instawallet.org/api/v1/w/ZJA1jrNoWTFahQ7txYtkmd0zvS3UH3p6fA/payment Parameters: address: 1AoACLLonFM4nRxGqaTrmJN3y1pYnXXg9j amount: 0.01 Error message: "Sorry, I was not able to parse the amount field." What is the correct format to send the Amount? Return: HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive Status: 200 X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.11 Strict-Transport-Security: max-age=31536000 X-UA-Compatible: IE=Edge,chrome=1 ETag: "13705d7997a434b4565ccbc0117d2592" Cache-Control: max-age=0, private, must-revalidate Set-Cookie: _instawallet_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJTk2ZGQ5Nzc1YTg5NDkzZjBmMWYyMTdiYmY4ZDViNTcwBjsAVA%3D%3D--de05b1f5a9620ac2fef0cb09b3e72173c08f92db; path=/; secure; HttpOnly X-Request-Id: dbe74c5f5883aad257c294ef064651ee X-Runtime: 0.007287 Date: Thu, 17 May 2012 18:18:06 GMT X-Rack-Cache: invalidate, pass Server: nginx/1.0.15 + Phusion Passenger 3.0.11 (mod_rails/mod_rack) { "successful": false, "message_code": 5, "message": "Sorry, I was not able to parse the amount field." } |