Skip to main content

User generated content Integration

content Creation

[use our mintDarkblockUpgrade endpoint(https://api.darkblock.io/v1/docs/swagger/#/Darkblock%20API/mint-upgrade-darkblock)]

Make sure you select the dev endpoint to hit as seen here:

We added a new parameter “type” where you can pass in a string. You can name it something descriptive for your protocol, or really whatever you want.

You will need to pass in the address of the person uploading the content as the creator_address and then ask them to generate a signature as shown in the docs on that page.

Darkblock Protocol Requests

Once Darkblock unlockable content is detected we need to construct a session token to access the content. This session token is a combination of the epoch timestamp (milliseconds), the signature of the concatenation of the current epoch timestamp and the wallet address of the user, and the chain. One session token is needed per chain, and can be cached, as they do not currently expire. They will be prone to expiration in the future, the rules around this will be coming soon based on partner feedback. Here is the format of the session token: epoch(millis)_signature_chain

Example:

Signature of 16529845012790x438cba7e454b59a9f897d4731fd3eaef37160c0a

Becomes the following session token:

1652984501279_0x23ddc5b8767a3c2c7c9bab3bdcb86c88a328d21b214e2edad91c6d40b4ad34860c99cfbbf06381c718d8ef3c8068145834ba9a2c8bd442afae7468fef1d10a2f1c_Ethereum

The ArtId can be taken from the Darkblock info response and combined with the session token, owner wallet address, NFT Contract and Token Id, and platform to construct a Gateway request. https://gateway.darkblock.io/proxy?artid=&session_token=&token_id=&contract=&platform=

Example:

https://gateway.darkblock.io/proxy?artid=9b3aa571-d42f-4699-b09f-6b6c76dab994&session_token=1652985436749_0x1c52329bee2409530b07ddce694df6e75671c3b51bde4aa02f25630f99c369e21d420301b7b7d89eb892b389f1fe32a262c3eae296d2ae81bc05805aca46d8f21c&token_id=30553606573219150352991292921105176340809048341686170040023897669293200900097&contract=0x495f947276749ce646f68ac8c248420045cb7b5e&platform=Ethereum

(not a working example)

For Ethereum compatible chains you can use this handy-dandy signature tool that allows you to paste in some arbitrary text and create a signature with Metamask: https://random-crap-public.s3.amazonaws.com/sign.html