Difference between revisions of "API Reference"
Jump to navigation
Jump to search
Line 32: | Line 32: | ||
* subject | * subject | ||
* message | * message | ||
− | * encodingtype | + | * [[Protocol_specification#Message_Encodings|encodingtype]] |
* receivedtime | * receivedtime | ||
− | The msgid is the same as the hash of the message (analogous to the TXID in Bitcoin). The encodingtype property is currently always set to 2 because, unfortunately, the inbox table in Bitmessage does not record the encoding type. In the future it | + | The msgid is the same as the hash of the message (analogous to the TXID in Bitcoin). The [[Protocol_specification#Message_Encodings|encodingtype]] property is currently always set to 2 because, unfortunately, the inbox table in Bitmessage does not record the encoding type. In the future Bitmessage will record it and at that time this field will be accurate therefore the field is included here to maintain forwards compatibility. |
Revision as of 22:13, 18 March 2013
Enable the API
To enable the API, copy and paste these lines into the bitmessagesettings section of the keys.dat file:
apienabled = true apiport = 8442 apiinterface = 127.0.0.1 apiusername = bradley apipassword = yourSuperWonderfulPassword98a8#5223345
List of Operations
Required arguments are denoted inside < and >
Command | Parameters | Description |
---|---|---|
listAddresses | Lists all addresses shown on the Your Identities tab. Returns a list of objects with these properties:
| |
createRandomAddress | <eighteenByteRipe> <label> | Creates one address using the random number generator. Supply a boolean telling Bitmessage whether to generate an address with an 18 byte ripe (as opposed to a 19 byte ripe). This is the same setting as the "Do extra work to make the address 1 or 2 characters shorter" in the user interface. Using False is recommended if you are running some sort of website and will be generating a lot of addresses.
Returns the address. |
createDeterministicAddresses | <passphrase> <addressVersionNumber> <streamNumber> <numberOfAddresses> <eighteenByteRipe> | Similar to the createRandomAddress except that you may generate many addresses in one go. Returns a list of new addresses. |
getAllInboxMessages |
Does not include the messages in the trash. Returns a list of objects with these properties:
The msgid is the same as the hash of the message (analogous to the TXID in Bitcoin). The encodingtype property is currently always set to 2 because, unfortunately, the inbox table in Bitmessage does not record the encoding type. In the future Bitmessage will record it and at that time this field will be accurate therefore the field is included here to maintain forwards compatibility. |