Broadcast Locally Signed Transaction

Through this endpoint customers can broadcast transactions that have been already signed locally. Instead of using a node for broadcasting a signed transaction users can use this endpoint. We then keep the user posted about the status by sending you a callback with a success or failure status.

This can be prepared and signed only locally, not through the API. We can provide support only for the process of broadcasting.

Supports Callback Functionality Single Result - This endpoint returns only one single result. POST /blockchain-tools/{blockchain}/{network}/transactions/broadcast

Path Parameters

  • Required
    blockchain string

    Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.

    Example : bitcoin
    Possible Values : bitcoin bitcoin-cash litecoin dogecoin dash ethereum ethereum-classic zcash binance-smart-chain
  • Required
    network string

    Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet" is the live network with actual data while networks like "testnet", "ropsten" are test networks.

    Possible Values : mainnet testnet ropsten mordor

Query parameters

  • Optional
    context string

    In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

Request body schema application/json

  • Optional
    context string

    In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

  • Required
    data object
    • Required
      item object
      • Optional
        callbackSecretKey string

        Represents the Secret Key value provided by the customer. This field is used for security purposes during the callback notification, in order to prove the sender of the callback as Crypto APIs. For more information please see our Documentation.

        Example : yourSecretString
      • Optional
        callbackUrl string

        Represents the URL that is set by the customer where the callback will be received at. The callback notification will be received only if and when the event occurs.

        Example : https://example.com
      • Required
        signedTransactionHex string

        Represents the signed transaction's specific hex.

        Example : 0xf86a22827d00831e8480941b85a43e2e7f52e766ddfdfa2b901c42cb1201be8801b27f33b807c0008029a084ccbf02b27e0842fb1eda7a187a5589c3759be0e969e0ca989dc469a5e5e394a02e111e1156b197f1de4c1d9ba4af26e50665ea6d617d05b3e4047da12b915e69

Response schema

201 400 401 402 403 404 409 415 422 429 500
HTTP Status Code: 201
Content-Type: application/json

The resource has been successfully created.

  • Object :

  • Required
    apiVersion string

    Specifies the version of the API that incorporates this endpoint.

    Example : 2.0
  • Required
    requestId string

    Defines the ID of the request. The requestId is generated by Crypto APIs and it's unique for every request.

    Example : 601c1710034ed6d407996b30
  • Optional
    context string

    In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

    Example : You can add any text here
  • Required
    data object
    • Required
      item object
      • Required
        transactionId string

        Represents the unique identifier of a transaction, i.e. it could be transactionId in UTXO-based protocols like Bitcoin, and transaction hash in Ethereum blockchain.

        Example : 347d96855d41b77f1e23048fff11c18e9fe699ee69b0b402338f34189734e0a2

Callback parameters Method : POST

You can use the optional parameter callbackSecretKey in your request for additional security. It is then used to create a unique hash string in the x-signature response header in the callback request itself. For more information, please see our Documentation.
BROADCAST_TRANSACTION_SUCCESS BROADCAST_TRANSACTION_FAIL

Content-Type : application/json

  • Object :

  • Required
    apiVersion string

    Specifies the version of the API that incorporates this endpoint.

    Example : 2.0
  • Required
    referenceId string

    Represents a unique identifier that serves as reference to the specific request which prompts a callback, e.g. Blockchain Events Subscription, Blockchain Automation, etc.

    Example : 6038d09050653d1f0e40584c
  • Required
    idempotencyKey string

    Specifies a unique ID generated by the system and attached to each callback. It is used by the server to recognize consecutive requests with the same data with the purpose not to perform the same operation twice.

    Example : e55bf7a4a7188855f1c27541a6c387d04cc3b22ee34d1304b0e6ecad61c9906c
  • Required
    data object

    Specifies all data, as attributes, included into the callback notification, which depends on the event.

    • Required
      product string

      Represents the Crypto APIs 2.0 product which sends the callback.

      Example : Blockchain Tools
    • Required
      event string

      Defines the specific event, for which a callback subscription is set.

      Example : BROADCAST_TRANSACTION_SUCCESS
    • Required
      item object

      Defines an item as one result.

      • Required
        blockchain string

        Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.

        Example : Bitcoin/Ethereum (whichever applicable)
      • Required
        network string

        Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet" is the live network with actual data while networks like "testnet", "ropsten", "rinkeby" are test networks.

        Example : Testnet/Mainnet (whichever applicable)
      • Required
        transactionId string

        Defines the unique ID of the specific transaction, i.e. its identification number.

        Example : 347d96855d41b77f1e23048fff11c18e9fe699ee69b0b402338f34189734e0a2

Credits Cost : 10 Credits For 1 Result(s)

Try it out

Request Example

POST
https://rest.cryptoapis.io/v2/blockchain-tools/bitcoin/network/transactions/broadcast
Headers
Host: https://rest.cryptoapis.io/v2
Content-Type: application/json
X-API-Key: my-api-key

Request Body
{
    "context": "",
    "data": {
        "item": {
            "callbackSecretKey": "yourSecretString",
            "callbackUrl": "https://example.com",
            "signedTransactionHex": "0xf86a22827d00831e8480941b85a43e2e7f52e766ddfdfa2b901c42cb1201be8801b27f33b807c0008029a084ccbf02b27e0842fb1eda7a187a5589c3759be0e969e0ca989dc469a5e5e394a02e111e1156b197f1de4c1d9ba4af26e50665ea6d617d05b3e4047da12b915e69"
        }
    }
}

Response Example

{
    "apiVersion": "2.0",
    "requestId": "601c1710034ed6d407996b30",
    "context": "You can add any text here",
    "data": {
        "item": {
            "transactionId": "347d96855d41b77f1e23048fff11c18e9fe699ee69b0b402338f34189734e0a2"
        }
    }
}

Callback Example

{
    "apiVersion": "2.0",
    "referenceId": "6038d09050653d1f0e40584c",
    "idempotencyKey": "e55bf7a4a7188855f1c27541a6c387d04cc3b22ee34d1304b0e6ecad61c9906c",
    "data": {
        "product": "Blockchain Tools",
        "event": "BROADCAST_TRANSACTION_SUCCESS",
        "item": {
            "blockchain": "Bitcoin\/Ethereum (whichever applicable)",
            "network": "Testnet\/Mainnet (whichever applicable)",
            "transactionId": "347d96855d41b77f1e23048fff11c18e9fe699ee69b0b402338f34189734e0a2"
        }
    }
}