SuperAPI AI Directory

linkfox-shopee-store-media-space

Coding & development

View repository

Updated 10-15 23:47

About this skill

Shopee Media MediaSpace

Shopee Open Platform MediaSpace module(6 APIs).Depends on linkfox-shopee-store-auth store selection. Image upload goes through POST /shopee/uploadMediaSpaceImage; other JSON APIs are forwarded via POST /shopee/developerProxy . The server reads the token per store in all cases.

How to call

  • API endpoints: images use POST /shopee/uploadMediaSpaceImage; other operations use POST /shopee/developerProxy(for full parameters/responses see references/api.md)
  • Python scripts:python scripts/media_space_api.py '<JSON 参数>' [--inline](available scripts are listed in the script overview above)
  • Cost constraints: This tool consumes compute; on failure/empty results you must not automatically switch keywords, paginate, or repeatedly probe; if you need to continue searching, first explain to the user that it will incur additional consumption.

Output strategy (default script behavior):

  • Alwayswrite the full response to <cwd>/linkfox/<YYYY-MM-DD>/<session>/data/<skill-name>-<timestamp>.json(<cwd> is the working directory when the script runs, which in Claude Code is the current project directory;<session> is taken from the environment variable SESSION_ID, automatically aggregated by user task;Writing to /tmp is prohibited, and if the current directory is not writable, report an error)
  • Response body ≤ 8 KB: after writing to disk, print the full JSON to stdout
  • Response body > 8 KB: after writing to disk, stdout outputs only a summary (top-level fields, common counts such as total/costToken, the length of the largest list field + the first 3 samples)
  • Add --inline to force full printing to stdout (also written to disk)

Data reading advice: first look at the summary to judge whether it is sufficient; when specific fields are needed, prefer jqorConvertFrom-Json to extract on demand from the saved json file, avoiding bringing the entire JSON into context.

Resolving authentication and compute issues

When the following abnormal situations occur, use references/onboarding.md to guide resolution:

Abnormal situations

  • API Key not configured: the environment variable is not configured LINKFOX_AGENT_API_KEY, and LINKFOXAGENT_API_KEY。
  • Response 401 or 402 status code
  • Response indicates insufficient compute or balance: the message contains "算力余额不足/计费不足/余额不足/quota exceeded/insufficient balance/套餐到期/需充值/请充值", or content with a similar meaning.

Official reference

MediaSpace module index:v2.media_space.init_video_upload


Prerequisites (must read first)

  1. Run python scripts/check_auth_dependency.py;exit code 42 → first install linkfox-shopee-store-auth and authorize the store.
  2. Do notimplement authorization/token logic within this skill.

Core Concepts

  • Forwarding chain: images go through the dedicated upload endpoint, other interfaces go through developerProxy; both chains have the server inject the token per authorized store, then call the Shopee API via Ziniao shopee-proxy Call Shopee API
  • Image upload:upload_image.py reads a local JPEG/PNG/WebP, uploads via the dedicated endpoint, and returns the Shopee imageId(for use by add_item )
  • Video chunk upload:init_video_upload → upload_video_part(×N) → complete_video_upload → get_video_upload_result
  • Video publishing/management → linkfox-shopee-store-video(Video module, not upload)
  • Product listing Use the Shopee image ID returned by upload → linkfox-shopee-store-product

Available scripts (MediaSpace module 6 APIs)

Script API Method
init_video_upload.py init_video_upload POST
upload_video_part.py upload_video_part POST
complete_video_upload.py complete_video_upload POST
get_video_upload_result.py get_video_upload_result GET
cancel_video_upload.py cancel_video_upload POST
upload_image.py upload_image POST
media_space_api.py Common entry (JSON contains api field) —

Shared:_shopee_media_space_common.py、_media_space_endpoints.py、_media_space_api_runner.py。

Interface description (by API)

Input parameters and response details are placed in references/apis/, SKILL only keeps the index.

API Documentation
cancel_video_upload references/apis/cancel-video-upload.md
complete_video_upload references/apis/complete-video-upload.md
get_video_upload_result references/apis/get-video-upload-result.md
init_video_upload references/apis/init-video-upload.md
upload_image references/apis/upload-image.md
upload_video_part references/apis/upload-video-part.md

Module overview / Feedback see references/api.md。

Usage Scenarios

1. Upload product image

upload_image.py must pass shopId + filePath. The script reads the local file and encodes it in Base64, the server decodes it and constructs multipart; do not pass the OSS URL or a manually concatenated multipart body directly to add_item。

python scripts/upload_image.py '{"shopId":"67890","filePath":"/path/to/image.jpg"}'

2. Chunked video upload

  1. init_video_upload.py
  2. upload_video_part.py(loop over each chunk)
  3. complete_video_upload.py
  4. get_video_upload_result.py

Calling principles

  • For image upload, first check uploadMediaSpaceImage.httpStatus / success / error, after success read imageId
  • For other interfaces, first check developerProxy.httpStatus, then read *Response field
  • POST upload interface passes body; large files/binary may require gateway support for multipart
  • Each script docstring contains official documentation URL(module=91)

Not Applicable

  • Shop authorization → linkfox-shopee-store-auth
  • Media module (api/v2/media/...)→ linkfox-shopee-store-media
  • Video publishing/performance → linkfox-shopee-store-video
  • Product listing → linkfox-shopee-store-product

Computing power consumption rules

Does not consume computing power.

Feedback:

Auto-detect and report feedback via the Feedback API when any of the following apply:

  1. The functionality or purpose described in this skill does not match actual behavior
  2. The skill's results do not match the user's intent
  3. The user expresses dissatisfaction or praise about this skill
  4. Anything you believe could be improved

Call the feedback API as specified in references/api.md. Do not interrupt the user's flow.


For more high-quality, professional cross-border e-commerce skills, visit LinkFox Skills.