04 Edit content
4.1 Description
PUT/contents/{id}
Only the six fields in the table below can be changed. Other values are ignored without error, so the idempotency identifier (external_id) and content type (content_type) can't be changed with this call. If none of the six fields are sent, the response is 400.
hashtags · platform_metadata · metadata are replaced as a whole. If you send only part, the rest is lost, so fetch the current value first, edit it, and send it back in full.
The shape of platform_metadata and the allowed channel keys are the same as described in POST /contents. The thing to watch here is full replacement.
Written on one line, it's {"platform_metadata": {"youtube": {"title": "유튜브용"}, "instagram": {"body": "인스타용"}}}. If you send {"platform_metadata": {"youtube": {"title": "새 제목"}}} here to change only YouTube, the Instagram part is lost. Edit the value you got from GET /contents first and send it back in full.
4.2 Parameters
| Name | Category | Description |
|---|---|---|
workspace | Required | Workspace code |
title | Optional | Shared title. 1 to 500 characters |
body | Optional | Shared body or description. Up to 10000 characters |
hashtags | Optional | Shared hashtags. Up to 60 strings, each up to 100 characters. Replaced as a whole |
language | Optional | Language code (e.g. ko · en-US) |
platform_metadata | Optional | Per-platform title and body overrides. Keys are channel keys; values are objects containing title · body. Must be an object, not an array, and is replaced as a whole |
metadata | Optional | Extended metadata from the production system. Must be an object, not an array, and is replaced as a whole |
4.3 Request
curl -X PUT https://moacast.com/api/moacast/v1/contents/{id} \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{"workspace":"a1b2c3d4"}'4.4 Success response
{
"result": "SUCCESS",
"result_code": 0,
"message": "콘텐츠를 수정했습니다.",
"data": {
"content": {
"id": 12,
"title": "9월 넷째 주 요약 (수정)",
"language": "ko",
"hashtags": [
"주간요약"
],
"publications": []
}
}
}4.5 Field
| Field | Type | Description |
|---|---|---|
content | object | The updated content. Same shape as one entry of GET /contents |
4.6 Failed
| Code | HTTP | When |
|---|---|---|
9912 | 400 | workspace was not provided |
1004 | 400 | A value doesn't meet the rules, or no editable field was sent |
1001 | 401 | Header is missing or the token is invalid |
1002 | 403 | The workspace is suspended |
1003 | 403 | A write call made with a session, but the request didn't originate from this site |
2000 | 404 | The workspace doesn't exist, or the content can't be found |
5000 | 503 | The content store isn't ready |
