← Marketplace
Skill

vika-api

技能
by vikadata

分类

Engineering

安装

0

Published

2026年5月2日

Updated

2026年5月2日

Vika.cn API Skill

Interact with Vika.cn via curl commands. No scripts needed - just direct API calls.

Setup

Before making API calls, ensure environment variables are set:

bash
# Set default host if not already set
[ -z "$VIKA_HOST" ] && export VIKA_HOST="https://vika.cn"

# API token is required (get from User Center > Developer Token)
# export VIKA_TOKEN="uskXXXXXXXXXXXXX"

Run the first line before any curl commands to ensure VIKA_HOST has the default value.

Quick Reference

OperationEndpointMethod
Get records/fusion/v1/datasheets/{dstId}/recordsGET
Create records/fusion/v1/datasheets/{dstId}/recordsPOST
Update records/fusion/v1/datasheets/{dstId}/recordsPATCH
Delete records/fusion/v1/datasheets/{dstId}/records?recordIds=DELETE
Get fields/fusion/v1/datasheets/{dstId}/fieldsGET
Create field/fusion/v1/spaces/{spcId}/datasheets/{dstId}/fieldsPOST
Delete field/fusion/v1/spaces/{spcId}/datasheets/{dstId}/fields/{fldId}DELETE
Get views/fusion/v1/datasheets/{dstId}/viewsGET
Create datasheet/fusion/v1/spaces/{spcId}/datasheetsPOST
Upload attachment/fusion/v1/datasheets/{dstId}/attachmentsPOST
Get spaces/fusion/v1/spacesGET
Get nodes/fusion/v1/spaces/{spcId}/nodesGET
Search nodes/fusion/v2/spaces/{spcId}/nodes?type=GET
Get node detail/fusion/v1/spaces/{spcId}/nodes/{nodeId}GET

Basic Examples

bash
# Get all records
curl -X GET "$VIKA_HOST/fusion/v1/datasheets/dstXXX/records" \
  -H "Authorization: Bearer $VIKA_TOKEN"

# Create records
curl -X POST "$VIKA_HOST/fusion/v1/datasheets/dstXXX/records" \
  -H "Authorization: Bearer $VIKA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"records":[{"fields":{"Title":"New Task","Status":"Todo"}}]}'

# Update records
curl -X PATCH "$VIKA_HOST/fusion/v1/datasheets/dstXXX/records" \
  -H "Authorization: Bearer $VIKA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"records":[{"recordId":"recXXX","fields":{"Status":"Done"}}]}'

# Delete records
curl -X DELETE "$VIKA_HOST/fusion/v1/datasheets/dstXXX/records?recordIds=recXXX&recordIds=recYYY" \
  -H "Authorization: Bearer $VIKA_TOKEN"

# Upload attachment
curl -X POST "$VIKA_HOST/fusion/v1/datasheets/dstXXX/attachments" \
  -H "Authorization: Bearer $VIKA_TOKEN" \
  -F "file=@/path/to/image.png"

# Get spaces list
curl -X GET "$VIKA_HOST/fusion/v1/spaces" \
  -H "Authorization: Bearer $VIKA_TOKEN"

# Search datasheets by name
curl -X GET "$VIKA_HOST/fusion/v2/spaces/spcXXX/nodes?type=Datasheet&query=keyword" \
  -H "Authorization: Bearer $VIKA_TOKEN"

Response Format

All responses:

json
{"success": true, "code": 200, "message": "SUCCESS", "data": {...}}

Important: cellFormat Parameter for Reading Records

When user wants to read/query records and does NOT specify cellFormat in their request, ASK them to choose:

"Which cell format do you prefer for the response?

  • string - Human-friendly format, all values converted to strings, dates formatted. Best for viewing data or exporting to CSV.
  • json - Structured format (default), preserves original types. Best for script processing or multi-step automation.

Use string for simple data viewing; use json for programmatic processing."

Usage:

bash
# Human-readable format (string)
curl -X GET "$VIKA_HOST/fusion/v1/datasheets/dstXXX/records?cellFormat=string" \
  -H "Authorization: Bearer $VIKA_TOKEN"

# Structured format for scripts (json, default)
curl -X GET "$VIKA_HOST/fusion/v1/datasheets/dstXXX/records?cellFormat=json" \
  -H "Authorization: Bearer $VIKA_TOKEN"

When to skip asking:

  • User mentions "human readable", "export CSV", "view data", "display" → use string
  • User mentions "script", "automation", "pipeline", "multi-step", "parse" → use json
  • Complex multi-step operations or chained commands → use json

Detailed Documentation

For complete parameter details and examples, read the reference files:

ReferenceWhen to read
references/records.mdRecord CRUD with filtering, sorting, pagination
references/fields.mdField types, create/delete fields
references/views.mdGet view list
references/datasheets.mdCreate new datasheets
references/attachments.mdUpload files and use in records
references/spaces-nodes.mdWorkspaces, folders, search
references/members-teams.mdUser and team management
references/field-types.mdAll field value formats

Tips

  1. Use fieldKey=id for stability (field IDs don't change when renamed)
  2. Max 10 records per create/update request
  3. URL-encode filterByFormula values
  4. Upload attachment first, then use its token in record fields