Webhooks

Describes how to configure and use webhooks for the NFT-API.

Intro

Introducing Webhooks that allow you to configure your endpoint URL and receive notifications for all your assets including contract, token-type, and token mints. Configure webhooks from the NFT-API product section on the Developer Portal.

NFT-API: Receive notifications for all the successful and failed contract creations, token-type creations, and token mints:

  • Contract Creation Succeeded
  • Contract Creation Failed
  • Token-type creation Succeeded
  • Token-type creation Failed
  • Token Mint Succeeded
  • Token Mint Failed

Retry Mechanism

If your endpoint URL is down, Venly will attempt to resend the notification message five times with an interval of 10 seconds in between to ensure delivery. After the last try, the message will be dropped since we don't store the webhook messages, they're not retrievable anymore.

In case your endpoint is down for more than 50 seconds and you don't receive the message:

NFT-API: You can call the check status endpoints using the unique id which is found in the response body for contract creation, token-type creation, and token mints as follows:

  1. Check Contract Status
  2. Check Token-type Status
  3. Check Token Mint Status

How to configure webhooks?

  1. Head over to the Developer Portal.
  2. Under Configuration, click on the product you want to configure webhooks for (NFT API)
  3. Scroll down and click on Create webhook
Creating a new Webhook for NFT API

Creating a new Webhook for NFT API

  1. Add the relevant information:
    1. Description: Any sample description of the webhook.
    2. Endpoint (POST): The endpoint URL that can accept POST calls.
    3. Type: Select your preferred authentication type.
    4. Username/ Header name: Enter your custom username or header name (depends on the authentication type you selected.)
    5. Password/ API key: Enter your custom password or API key (depends on the authentication type you selected).
    6. Finally, click Create.

📘

Authentication is to be set up by you for your endpoint. This allows you to verify that the calls are coming from Venly.

Adding details for the Webhook

Adding details for the Webhook

  1. The webhook is created successfully!
Webhook created successfully

Webhook created successfully

  1. Click on the three dots to update or delete a webhook.
Update or Delete Webhook

Update or Delete Webhook

Successful Payload Examples

Following are the examples of payloads that you will receive for successful token mints, token-type creation, and contract creation.

📘

In the payloads you receieve, look for eventType and result.status.

Successful Token Mint

{
  "eventType": "TOKEN_CREATION_SUCCEEDED",
  "result": {
    "id": "3eab2361-5f0e-4122-8fe9-74b6f1fe0a88",
    "tokenId": 2,
    "status": "SUCCEEDED",
    "transactionHash": "0x407845cb6ce187a9f982aa00f4870851fe8877ef599e9d28084210373619dc14",
    "destination": {
      "address": "0x7312750DF4d2057b758a61C7017729c6Ec9bB3E9",
      "amount": 1
    },
    "metadata": {
      "name": "Test Token-type",
      "description": "Test token-type creation",
      "image": "https://play-lh.googleusercontent.com/ugkfJ2icapJi3vuS3WQfls6b8aM_YgcA_2Np18pg28vTLLbpeS2UEOWz9NvtB8oYGw=w240-h480-rw",
      "imagePreview": "https://play-lh.googleusercontent.com/ugkfJ2icapJi3vuS3WQfls6b8aM_YgcA_2Np18pg28vTLLbpeS2UEOWz9NvtB8oYGw=w240-h480-rw",
      "imageThumbnail": "https://play-lh.googleusercontent.com/ugkfJ2icapJi3vuS3WQfls6b8aM_YgcA_2Np18pg28vTLLbpeS2UEOWz9NvtB8oYGw=w240-h480-rw",
      "externalUrl": "www.venly.io",
      "external_url": "www.venly.io",
      "animationUrls": [],
      "attributes": [
        {
          "type": "stat",
          "name": "Health",
          "value": "98",
          "maxValue": "100",
          "displayType": "number",
          "display_type": "number",
          "traitType": "Health",
          "trait_type": "Health"
        },
        {
          "type": "system",
          "name": "tokenTypeId",
          "value": "1",
          "traitType": "Token Type ID",
          "trait_type": "Token Type ID"
        },
        {
          "type": "property",
          "name": "maxSupply",
          "value": "50",
          "traitType": "Max Supply",
          "trait_type": "Max Supply"
        },
        {
          "type": "property",
          "name": "mintNumber",
          "value": "1",
          "traitType": "Mint Number",
          "trait_type": "Mint Number"
        }
      ],
      "contract": {
        "address": "0xf5b11b4f458cc12a7989a146c5db2e7d500e2241",
        "name": "Test",
        "symbol": "TE",
        "image": "string",
        "imageUrl": "string",
        "image_url": "string",
        "description": "Testing",
        "externalLink": "www.venly.io",
        "external_link": "www.venly.io",
        "externalUrl": "www.venly.io",
        "external_url": "www.venly.io",
        "media": [],
        "type": "ERC_1155"
      },
      "fungible": false
    }
  }
}

Successful Token-type Creation

{
  "eventType": "TOKEN_TYPE_CREATION_SUCCEEDED",
  "result": {
    "id": "6852f668-2609-43fb-869e-a1de2e429ea9",
    "status": "SUCCEEDED",
    "transactionHash": "0x04778d3c6dfa2418a55fe53317520744b0e00100ff4453fd7892fa28f0f146fe",
    "tokenTypeId": 1,
    "metadata": {
      "name": "Test Token-type",
      "description": "Test token-type creation",
      "image": "https://play-lh.googleusercontent.com/ugkfJ2icapJi3vuS3WQfls6b8aM_YgcA_2Np18pg28vTLLbpeS2UEOWz9NvtB8oYGw=w240-h480-rw",
      "imagePreview": "https://play-lh.googleusercontent.com/ugkfJ2icapJi3vuS3WQfls6b8aM_YgcA_2Np18pg28vTLLbpeS2UEOWz9NvtB8oYGw=w240-h480-rw",
      "imageThumbnail": "https://play-lh.googleusercontent.com/ugkfJ2icapJi3vuS3WQfls6b8aM_YgcA_2Np18pg28vTLLbpeS2UEOWz9NvtB8oYGw=w240-h480-rw",
      "externalUrl": "www.venly.io",
      "external_url": "www.venly.io",
      "animationUrls": [],
      "attributes": [
        {
          "type": "stat",
          "name": "Health",
          "value": "98",
          "maxValue": "100",
          "displayType": "number",
          "display_type": "number",
          "traitType": "Health",
          "trait_type": "Health"
        },
        {
          "type": "system",
          "name": "tokenTypeId",
          "value": "1",
          "traitType": "Token Type ID",
          "trait_type": "Token Type ID"
        },
        {
          "type": "property",
          "name": "maxSupply",
          "value": "50",
          "traitType": "Max Supply",
          "trait_type": "Max Supply"
        }
      ],
      "contract": {
        "address": "0xf5b11b4f458cc12a7989a146c5db2e7d500e2241",
        "name": "Test",
        "symbol": "TE",
        "image": "string",
        "imageUrl": "string",
        "image_url": "string",
        "description": "Testing",
        "externalLink": "www.venly.io",
        "external_link": "www.venly.io",
        "externalUrl": "www.venly.io",
        "external_url": "www.venly.io",
        "media": [],
        "type": "ERC_1155"
      },
      "fungible": false
    }
  }
}

Successful Contract Creation

{
  "eventType": "CONTRACT_CREATION_SUCCEEDED",
  "result": {
    "name": "Test",
    "description": "Testing",
    "address": "0xf5b11b4f458cc12a7989a146c5db2e7d500e2241",
    "id": "a46bef57-c2b9-4eb7-8819-d0b38c445809",
    "secretType": "MATIC",
    "symbol": "TE",
    "externalUrl": "www.venly.io",
    "image": "string",
    "media": [],
    "transactionHash": "0xad5633541e106be988c30e51b2fcb2a997ac80610d095bfcf5c363d0df8fbea3",
    "status": "SUCCEEDED",
    "storage": {
      "type": "cloud",
      "location": "https://metadata-qa.arkane.network/metadata/contracts/10816"
    },
    "contractUri": "https://metadata-qa.arkane.network/metadata/contracts/10816",
    "external_link": "www.venly.io"
  }
}

Failed Payload Examples

Following are the examples of payloads that you will receive for failed token mints, token-type creation, and contract creation.

Failed Token Mint

{
    "eventType": "TOKEN_CREATION_FAILED",
    "result": {
        "id": "f9754e80-ebb0-4cf9-8e82-c4191dd0b44f",
        "tokenId": 20,
        "status": "FAILED",
        "transactionHash": "0x98cfcd58282edc8a6d3f329a01a7350b7f148c31546b1a5c29e0311f339eb8e8",
        "destination": {
            "address": "0x6490d80c70990f27f50fee6189829cefe584998a",
            "amount": 1
        },
        "metadata": {
            "name": "DAR-TOKTYP-56",
            "description": "DAR-TOKEN-TYPE-56",
            "image": "https://storage-qa.venly.io/applications/1f64ded9-2a05-4824-b682-661023359357/coll_marvel.png",
            "imagePreview": "https://storage-qa.venly.io/applications/1f64ded9-2a05-4824-b682-661023359357/coll_marvel.png",
            "imageThumbnail": "https://storage-qa.venly.io/applications/1f64ded9-2a05-4824-b682-661023359357/coll_marvel.png",
            "backgroundColor": "#021200",
            "background_color": "#021200",
            "animationUrl": "https://i.pinimg.com/originals/6a/34/9e/6a349ef34e90c467cf7bd5804de6b095.gif",
            "animation_url": "https://i.pinimg.com/originals/6a/34/9e/6a349ef34e90c467cf7bd5804de6b095.gif",
            "externalUrl": "https://en.wikipedia.org/wiki/Space_Chickens_in_Space",
            "external_url": "https://en.wikipedia.org/wiki/Space_Chickens_in_Space",
            "animationUrls": [
                {
                    "type": "GIF",
                    "value": "https://i.pinimg.com/originals/6a/34/9e/6a349ef34e90c467cf7bd5804de6b095.gif"
                }
            ],
            "attributes": [
                {
                    "type": "property",
                    "name": "Gold",
                    "value": "8",
                    "maxValue": "10",
                    "traitType": "Gold",
                    "trait_type": "Gold"
                },
                {
                    "type": "property",
                    "name": "Silver",
                    "value": "2",
                    "maxValue": "200",
                    "traitType": "Silver",
                    "trait_type": "Silver"
                },
                {
                    "type": "system",
                    "name": "tokenTypeId",
                    "value": "16",
                    "traitType": "Token Type ID",
                    "trait_type": "Token Type ID"
                },
                {
                    "type": "property",
                    "name": "maxSupply",
                    "value": "25",
                    "traitType": "Max Supply",
                    "trait_type": "Max Supply"
                }
            ],
            "contract": {
                "address": "0x6490d80c70990f27f50fee6189829cefe584998a",
                "name": "DAR-CONTR-49",
                "symbol": "DC42",
                "image": "https://storage-qa.venly.io/applications/1f64ded9-2a05-4824-b682-661023359357/coll_marvel.png",
                "imageUrl": "https://storage-qa.venly.io/applications/1f64ded9-2a05-4824-b682-661023359357/coll_marvel.png",
                "image_url": "https://storage-qa.venly.io/applications/1f64ded9-2a05-4824-b682-661023359357/coll_marvel.png",
                "description": "DAR-CONTRACT-49",
                "externalLink": "https://en.wikipedia.org/wiki/Stick_figure",
                "external_link": "https://en.wikipedia.org/wiki/Stick_figure",
                "externalUrl": "https://en.wikipedia.org/wiki/Stick_figure",
                "external_url": "https://en.wikipedia.org/wiki/Stick_figure",
                "media": [],
                "type": "ERC_1155"
            },
            "fungible": false
        },
        "errorMessage": "Transaction failed"
    }
}

Failed Token-type Creation

{
    "eventType": "TOKEN_TYPE_CREATION_FAILED",
    "result":
    {
        "id": "e2abb6d1-26c6-422c-9643-b42c17c5c705",
        "status": "FAILED",
        "tokenTypeId": 34,
        "metadata":
        {
            "name": "string",
            "description": "PLEASE_FAIL",
            "image": "string",
            "imagePreview": "string",
            "imageThumbnail": "string",
            "backgroundColor": "string",
            "background_color": "string",
            "animationUrl": "string",
            "animation_url": "string",
            "externalUrl": "string",
            "external_url": "string",
            "animationUrls":
            [
                {
                    "type": "string",
                    "value": "string"
                }
            ],
            "attributes":
            [
                {
                    "type": "stat",
                    "name": "string",
                    "value": "string",
                    "maxValue": "string",
                    "displayType": "number",
                    "display_type": "number",
                    "traitType": "string",
                    "trait_type": "string"
                },
                {
                    "type": "system",
                    "name": "tokenTypeId",
                    "value": "34",
                    "traitType": "Token Type ID",
                    "trait_type": "Token Type ID"
                },
                {
                    "type": "property",
                    "name": "maxSupply",
                    "value": "1034534534634256245643564562456245645624562456245645624562546425645642562546245624564562645625",
                    "traitType": "Max Supply",
                    "trait_type": "Max Supply"
                }
            ],
            "contract":
            {
                "address": "0xde4cefc86a28c9a13d4a0846f322b9b5713b1a57",
                "name": "Kurt Remarque - updated",
                "symbol": "KURE",
                "image": "https://storage-qa.venly.io/applications/d047a0a7-bf8f-46e4-a3fd-561a94bfd114/matic.png",
                "imageUrl": "https://storage-qa.venly.io/applications/d047a0a7-bf8f-46e4-a3fd-561a94bfd114/matic.png",
                "image_url": "https://storage-qa.venly.io/applications/d047a0a7-bf8f-46e4-a3fd-561a94bfd114/matic.png",
                "description": "Modi qui id maiores.",
                "externalLink": "https://en.wikipedia.org/wiki/Stick_figure",
                "external_link": "https://en.wikipedia.org/wiki/Stick_figure",
                "externalUrl": "https://en.wikipedia.org/wiki/Stick_figure",
                "external_url": "https://en.wikipedia.org/wiki/Stick_figure",
                "media":
                [],
                "type": "ERC_1155"
            },
            "fungible": true
        },
        "errorMessage": "Could not prepare transaction. Bit size must be 8 bit aligned, and in range 0 < bitSize <= 256"
    }
}

Failed Contract Creation

{
    "eventType": "CONTRACT_CREATION_FAILED",
    "result": {
        "name": "DAR-CONTR-69",
        "description": "DAR-CONTRACT-69",
        "id": "3fe78ac7-f8e9-4f60-acfe-8829df5bcca0",
        "secretType": "MATIC",
        "symbol": "DC62",
        "externalUrl": "https://en.wikipedia.org/wiki/Stick_figure",
        "image": "https://storage-qa.venly.io/applications/1f64ded9-2a05-4824-b682-661023359357/coll_marvel.png",
        "media": [],
        "status": "FAILED",
        "owner": "0x075Eea524899C9dEF536D327A27Efce4fC9795ca",
        "storage": {
            "type": "cloud",
            "location": "https://metadata-staging.arkane.network/metadata/contracts/64653"
        },
        "contractUri": "https://metadata-staging.arkane.network/metadata/contracts/64653",
        "external_link": "https://en.wikipedia.org/wiki/Stick_figure"
    }
}