How do I add multiple recipients for transactions via Blockchain API

0 votes
recipes ={'1Pd9gXJ8EqyGrqMKVevQWNjjF4B4dcSykf':10000,'14gVMjoCbjaGU3s9EQghVxYTAJgkmqqtHV':10000

Trying to send bitcoins using Blockchain.info API to both addresses in the recipes above.

This is my request:

url_multi = 'https://blockchain.info/nl/merchant/MYKEY/sendmany?password=MYPASSWORD&recipients='+recipes+'&fee=15000'

requests.get(url_multi)

I am getting the following trypeerror: TypeError: cannot concatenate 'str' and 'dict' objects

How do I add multiple recipients to the request without using a dict?

Jul 6, 2018 in Blockchain by sabby
• 4,390 points
863 views

1 answer to this question.

0 votes

Convert the recipes into JSON objects.

x = json.dumps(recipes) 

url_multi = 'https://blockchain.info/nl/merchant/MYKEY/sendmany?password=MYPASSWORD&recipients='+x+'&fee=15000'

requests.get(url_multi)

answered Jul 6, 2018 by Perry
• 17,100 points

Related Questions In Blockchain

0 votes
1 answer
+1 vote
1 answer
0 votes
1 answer
+3 votes
4 answers

How do I add a new node on a Hyperledger network?

You can do this by generating the crypto ...READ MORE

answered Apr 7, 2018 in Blockchain by Christine
• 15,790 points
5,656 views
+1 vote
3 answers

Removing double quotes from a string from JSON response in PHP

Just remove the json_encode call, and it should work: $resp ...READ MORE

answered Sep 12, 2018 in Blockchain by digger
• 26,740 points
45,157 views
0 votes
1 answer

Python request module for bitcoin json rpc

This should work: #!/usr/bin/env python import getpass import json import requests ...READ MORE

answered Aug 28, 2018 in Blockchain by digger
• 26,740 points
2,345 views
0 votes
0 answers

Blockchain.info wallet API callback

I am implementing blockchain.info wallet api to ...READ MORE

Jul 4, 2018 in Blockchain by sabby
• 4,390 points
868 views
0 votes
1 answer

Send Payment error in Blockchain API

The following code should help: $address = null; try ...READ MORE

answered Jul 6, 2018 in Blockchain by Perry
• 17,100 points
1,743 views
0 votes
1 answer

How do I develop a supply chain DApp on Blockchain?

Either of the ways is acceptable but ...READ MORE

answered May 30, 2018 in Blockchain by Perry
• 17,100 points
1,485 views
0 votes
1 answer

How do I withdraw the balance from a contract on Ethereum test blockchain?

Your need to improvise your code a ...READ MORE

answered Aug 3, 2018 in Blockchain by Perry
• 17,100 points
2,643 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP