用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/rawveg/skillsforge-marketplace --skill snapas命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | snapas |
| description | Snap.as API Documentation |
Comprehensive assistance with Snap.as API development, enabling photo upload and management through the Write.as suite.
This skill should be triggered when:
All Snap.as API requests require a Write.as user access token in the Authorization header:
Authorization: Token 00000000-0000-0000-0000-000000000000
curl https://snap.as/api/photos/upload \
-H "Authorization: Token YOUR_ACCESS_TOKEN" \
-F "file=@/path/to/photo.jpg"
Response (201 Created):
{
"code": 201,
"data": {
"id": "abc123",
"filename": "photo.jpg",
"size": 245760,
"url": "https://i.snap.as/abc123.jpg"
}
}
curl -X POST https://snap.as/api/me/photos \
-H "Authorization: Token YOUR_ACCESS_TOKEN"
Response (200 OK):
{
"code": 200,
"data": [
{
"id": "abc123",
"filename": "photo.jpg",
"size": 245760,
"url": "https://i.snap.as/abc123.jpg"
}
]
}
curl -X POST https://snap.as/api/photos/abc123 \
-H "Authorization: Token YOUR_ACCESS_TOKEN"
Response (200 OK):
{
"code": 200,
"data": {}
}
curl https://snap.as/api/organizations/myorg/photos/upload \
-H "Authorization: Token YOUR_ACCESS_TOKEN" \
-F "file=@/path/to/photo.jpg"
Response (201 Created):
{
"code": 201,
"data": {
"id": "xyz789",
"filename": "photo.jpg",
"size": 245760,
"url": "https://i.snap.as/xyz789.jpg"
}
}
{
"code": 401,
"error_msg": "Invalid access token"
}
import "github.com/snapas/go-snapas"
// Initialize client
client := snapas.NewClient("YOUR_ACCESS_TOKEN")
// Upload photo
photo, err := client.UploadPhoto("/path/to/photo.jpg")
if err != nil {
log.Fatal(err)
}
fmt.Printf("Photo URL: %s\n", photo.URL)
Snap.as uses Write.as user access tokens for authentication. These tokens must be obtained by logging into Write.as and retrieving the user's access credentials. Include the token in the Authorization header of every API request.
All API requests are made to https://snap.as with specific endpoint paths appended.
Photo objects returned by the API contain:
id: Unique identifier for the photofilename: Original filename of the uploaded photosize: File size in bytesurl: Public URL where the photo can be accessedAll successful API responses follow a consistent structure:
{
"code": <HTTP_STATUS_CODE>,
"data": <RESPONSE_DATA>
}
Failed requests return:
{
"code": <HTTP_STATUS_CODE>,
"error_msg": "<ERROR_MESSAGE>"
}
200 OK: Request succeeded201 Created: Resource created successfully400 Bad Request: Invalid request parameters401 Unauthorized: Invalid or missing access token403 Forbidden: Access denied to resource404 Not Found: Resource does not exist429 Too Many Requests: Rate limit exceeded/api/photos/upload/api/organizations/{alias}/photos/uploadThis skill includes comprehensive documentation in references/:
Use view to read the API reference file when detailed information is needed about specific endpoints or response formats.
Start by understanding the authentication mechanism. You'll need a Write.as user access token before making any API requests. Test with simple photo uploads to your personal account before working with organizational features.
Focus on the personal photo upload and retrieval endpoints first. Implement proper error handling for common scenarios like authentication failures (401), rate limiting (429), and invalid requests (400).
Once comfortable with personal uploads, explore organizational photo management. Organizations require the organization alias in the endpoint URL and appropriate access permissions.
Use the official go-snapas client library available at github.com/snapas/go-snapas for a more convenient development experience with built-in error handling and type safety.
/api/photos/upload with multipart form data/api/me/photosasync function uploadPhoto(file, accessToken) {
const formData = new FormData();
formData.append('file', file);
try {
const response = await fetch('https://snap.as/api/photos/upload', {
method: 'POST',
headers: {
'Authorization': `Token ${accessToken}`
},
body: formData
});
const data = await response.json();
if (!response.ok) {
throw new Error(data.error_msg || 'Upload failed');
}
return data.data;
} catch (error) {
console.error('Photo upload error:', error);
throw error;
}
}
github.com/snapas/go-snapashttps://snap.as/api/photos/upload/api/me/photos/api/photos/{PHOTO_ID}/api/organizations/{alias}/photos/uploadSince Snap.as is part of the Write.as suite, authentication happens through Write.as user accounts. Ensure users have valid Write.as credentials before attempting to use Snap.as features.
To refresh this skill with updated documentation: