LogoLogo
  • 🚀DeSo Vision
  • 🪙DeSo Tokenomics
    • No Equity, Just Coins and Code
    • Current DESO Supply
    • Initial DESO Distribution
    • DESO Sinks
    • The BMF: Burn-Maximizing Fee Mechanism
    • Designed for the End-Game
  • 🏛️DeSo Governance
  • ⭐DeSo Tutorial (Build Apps)
  • 🖥️Node Architecture Overview
    • Setup a Node & Frontend Locally
    • Making Your First Changes
  • 📅DeSo Roadmap
  • 🔍DeSo Block Explorer
  • 💸DeSo Wallet
  • 💬DeSo Chat Protocol
  • 👽Openfund
  • 👀Focus
  • 🛠️DeSo Tech Stack
  • 🌐DeSo Applications
  • DeSo Blockchain
    • 1️⃣Bare Metal
    • 2️⃣Scaling Roadmap
    • 3️⃣Content Moderation
    • 4️⃣Infinite-State
    • 5️⃣On-Chain Data
    • 6️⃣Smart Services
    • 7️⃣User Security
  • DeSo Features
    • 1️⃣Associations
    • 2️⃣Creator Coins
    • 3️⃣Feeds & Moderation
    • 4️⃣Social NFTs
    • 5️⃣Social Tipping
  • DeSo Identity
    • 1️⃣Identity: Overview
      • Core Concepts
      • Mobile Integration
    • 2️⃣Identity: iFrame API
      • Overview
      • Endpoints
    • 3️⃣Identity: Window API
      • Overview
      • Endpoints
  • DESO FRONTEND
    • 1️⃣Frontend: Get Started
    • 2️⃣Frontend: React Example
  • DESO BACKEND
    • 1️⃣Backend: Config
      • Onboarding
      • Phone Number Verification
      • Global State
      • Admins
      • Web Security
      • Media
        • Images
        • Videos
      • Hot Feed
      • Selling $DESO
        • Wyre - Buy with USD
        • Buy with BTC
        • Buy with ETH
      • Analytics
      • Emails
      • Supply Monitoring
    • 2️⃣Construct: API
      • Social Transactions API
      • NFT Transactions API
      • Financial Transactions API
      • Derived Keys Transaction API
      • DeSo Tokens Transactions API
      • Associations Transactions API
      • Access Groups API
    • 3️⃣Data: API
      • Admin Endpoints
      • Associations Endpoints
      • DeSo Tokens Endpoints
      • Media Endpoints
      • Miner Endpoints
      • Notification Endpoints
      • NFT Endpoints
      • Social Endpoints
      • Referral Endpoints
      • Tutorial Endpoints
      • Meta Data Endpoints
      • Transaction Spending Limits Endpoints
      • User Endpoints
      • Post Endpoints
      • Messages Endpoints
      • Access Group Endpoints
    • 4️⃣Transactions: API
  • DeSo Exchange Listings
    • 1️⃣Exchange Listing: API
  • DeSo Nodes
    • 2️⃣Node: Setup
    • 3️⃣Node: Staying Up-To-Date
    • 4️⃣Node: FAQ
  • DESO VALIDATORS
    • 1️⃣Run a Validator
  • Openfund
    • What is Openfund?
    • Openfund Tokenomics
    • Openfund Governance
    • Algorithmic Trading
      • The DeSo Python SDK
    • The DeSo Python SDK
      • Getting Help from the Community
      • Creating DeSo Testnet Accounts
      • Debugging Tips and Code Walkthrough
      • Write Blockchain Bots with AI
      • Market-Making Bots
      • Social AI Agents
      • AI-Generating Your Code
    • How Do the Advanced AMMs Work?
  • Focus
    • The Crypto Social Network
    • Next-Generation Token Mechanics
      • Launching Your Token
      • How the Order-Book AMMs Work
    • Crypto-Native Monetization
    • Focus Tokenomics
    • The Social Airdrop
    • Decentralizing Social Media
  • Contact And Media
    • ☀️DeSo Website
    • 📑DeSo Blog
    • 💻DeSo Github
    • 💎DeSo Diamond
    • 🐦DeSo Twitter
    • 📺DeSo YouTube
    • 📬Contact US
    • ⚠️Reporting an Account or Post
  • 中文
    • 什么是DeSo? (What is DeSo?)
    • 愿景 (The Vision)
Powered by GitBook
On this page
  • Upload Image
  • Upload Video
  • Get Video Status
  • Get Full TikTok URL

Was this helpful?

  1. DESO BACKEND
  2. Data: API

Media Endpoints

Description of endpoints used to manage media uploads for posts on the DeSo blockchain

PreviousDeSo Tokens EndpointsNextMiner Endpoints

Last updated 2 years ago

Was this helpful?

Upload Image

POST /api/v0/upload-image

Uploads an image to be included in a post and returns the URL where the image is stored. This endpoint also handles the resizing of the image.

Note that the request body should have multipart/form-data as the content type.

Endpoint implementation in .

Example usages in frontend: - Make request to - Use UploadImage to

Request Body

Name
Type
Description

UserPublicKeyBase58Check*

String

Public key of the user uploading the image.

JWT*

String

JWT of the user uploading the image.

file*

File

image file to upload. Must be gif, jpeg, png, or webp file. Must be less than 10 MB

{
  "ImageURL": "https://images.deso.org/675fc5d13f397d6ce7801b0a76ca928822a768b606d16df1eb015b2e84ed81e5.gif"
}
Name
Type
Description

ImageURL

String

URL at which the uploaded image can be found

{
    // Response
}

Upload Video

POST /api/v0/upload-video

UploadVideo creates a one-time tokenized URL that can be used to upload larger video files using the tus protocol. The client uses the Location header in the response from this function to upload the file. The client uses the Stream-Media-Id header in the response from cloudflare to understand how to access the file for streaming.

Headers

Name
Type
Description

Upload-Length*

Number

Length of video to be uploaded in bytes

Upload-Metadata

JSON

The Location header specifies the one-time tokenized URL. The Stream-Media-Id header is the ID used to stream the video from cloudflare after uploading the video.

{
    // Response
}

Get Video Status

GET /api/v0/get-video-status/{videoId}

Get Video Status queries cloudflare's API to see if a video is ready to be streamed. This is useful in showing a preview of an uploaded video to an end-user when they are creating a post.

Path Parameters

Name
Type
Description

videoId*

String

videoId retrieved from the stream-media-id header when uploading a video

{
  "ReadyToStream": true // If true, video is ready to stream. If false, video is not ready to strea
}
Name
Type
Description

ReadyToStream

Boolean

If true, the video is ready to be streamed. If false, the video is still being processed by cloudflare

{
    // Response
}

Get Full TikTok URL

POST /api/v0/get-full-tiktok-url

Given a short video ID of a TikTok, find the URL that can be used to embed this video. The short URL users get when copying a link to a TikTok from TikTok's mobile app isn't embeddable, so this endpoint allows us to find the desktop version of the URL from which we can construct an embeddable version of the URL.

Request Body

Name
Type
Description

TikTokShortVideoID*

String

Video ID found at the end of a URL copied from the TikTok mobile app.

For example, TTPd2Eobq3 is the VideoID in https://vm.tiktok.com/TTPd2Eobq3/`

{
  "FullTikTokURL": "https://m.tiktok.com/v/7037137657872403718.html?_d=secCgYIASAHKAESPgo8T1WVnwCQv6PNczjlfPqZ%2BVrGtkECbrVIwDlSfs8Eubr5IYCCt7sen3HRJwDN44tt0IeLho5JoaUMWgAnGgA%3D&checksum=be13618b6e8d0eacdf95a8abd952ca14e997a5af0126908fb195dca7ab5082d5&language=en&preview_pb=0&sec_user_id=MS4wLjABAAAACRLophxm1bvJ6oYFi4m52AIzepq8Naslxs3ATZs1YCLXomDfhhDOvxsW9DemYFYU&share_app_id=1233&share_item_id=7037137657872403718&share_link_id=2E462ECA-A6B5-44CF-9A9A-BD3F25E5F6FF&source=h5_m&timestamp=1638557967&tt_from=copy&u_code=djcd82ge94k75m&user_id=6980837453575472134&utm_campaign=client_share&utm_medium=ios&utm_source=copy"
}
Name
Type
Description

FullTikTokURL

String

Desktop version of the mobile TikTok URL provided in the request body that can be embedded in a post

{
    // Response
}

For more details, see the Cloudflare documentation on direct creator uploads

Endpoint implementation in .

For an example of uploading a video using this endpoint and the tus protocol, see the . After the upload finishes, you can check if the video is ready to be streamed by hitting the Get Video Statusendpoint

Arbitrary metadata values - see

Endpoint implementation in .

Example usage in frontend: - Make request to - Use GetVideoStatus to

Endpoint implementation in .

Example usages in frontend: - Make request to - Use GetFullTikTokURL to

3️⃣
backend
Upload Image
upload an image when a user is making a post
here
backend
implementation in frontend
backend
Get Video Status
poll and see if a video is ready to be streamed after a user finished uploading it.
backend
Get Full TikTok URL
get an embeddable URL for the short form TikTok url
cloudflare documentation for more details