일반글, 혹은 반응글을 작성하는 API입니다.
지원 형식
xml, json
요청 주소(Request URL)
https://apis.daum.net/yozm/v1_0/message/add.[xml|json]
인증(Authorization)
OAuth
HTTP Method
POST, GET
요청 변수(Request Parameters)
parameter
| 요청 변수 | 값 | 설명 |
|---|---|---|
| message | string(필수) | 메시지, 길이는 변경될 수 있습니다. 주의: 제목에 &, > 같은 기호가 있을 경우 그대로 전달해야 합니다. \&\; 등과 같이 변환을 해서 보내면 그대로 노출됩니다!!! |
| url_shorten | string |
|
| parent_msg_id | integer | 해당 글이 reply로 달리게 될 글의 msgid (이 값이 있을 경우 글은 반응글로 작성됩니다.) |
| img_url | string | 첨부할 이미지 주소, img_data가 있을시 img_url은 무시 |
| img_data | multipart file data | 첨부할 이미지 데이터(2MB 이하), img_data가 있을시 img_url은 무시 |
치환자
LINK
- ##_LINK|text|url(|urlshorten)_##
- 주의 : _ 하나 임
- text,url : 필수
- urlshorten : 옵션
POPUP
- ##_POPUP|text|url|width|height(|urlshorten)_##
- text,url,width,height : 필수
- urlshorten : 옵션
출력 결과
common response
| 출력 변수 | 설명 |
|---|---|
| result_msg | 결과 메세지 OR 에러 메세지 |
| status |
|
message
| 출력 변수 | 값 | 설명 |
|---|---|---|
| msg_id | numeric | 메세지 고유 id |
| type | string | 메세지 종류 (O:일반, Q:소문, R:반응(댓글), N:공지(알림) |
| text | string | DB에 입력된 메세지 내용(치환자를 포함하고 있음) |
| plain_text | string | 순수한 입력 메세지 |
| html_text | string | yozm 내부에서 사용하는 @@(맨션), [](태그), ##LINK__##(링크치환자)를 모두 html a tag로 변환한 html text |
| original_msg | message | 소문낸 글의 원본 message |
| parent_msg | message | 반응글의 원본 message |
| source_name | string | 메세지 작성 출처 이름 |
| reply_cnt | integer | 반응 갯수 |
| quote_cnt | integer | 소문 갯수 |
| favorited | string | 사용자가 해당 메세지를 즐겨찾기 했는지 여부. daumid를 넘기지 않으면 모두 false |
| user | user |
|
| attachment | attachment |
|
| permanent_url | 메세지의 고유 url | |
| pub_date | string | 메세지 작성일 |
출력 방식
xml
<info> <result_msg><![CDATA[OK]]></result_msg> <message> <text><![CDATA[test]]></text> <msg_id>78646643</msg_id> <type><![CDATA[O]]></type> <plain_text><![CDATA[test]]></plain_text> <html_text><![CDATA[test]]></html_text> <source_id>1</source_id> <user> <profile_img_url><![CDATA[http://cfile137.uf.daum.net/image/205076274B20D48657571E]]></profile_img_url> <url_name><![CDATA[goodfeel]]></url_name> <nickname><![CDATA[iphone]]></nickname> </user> <reply_cnt>0</reply_cnt> <quote_cnt>0</quote_cnt> <attachment /> <source_name><![CDATA[모바일]]></source_name> <pub_date><![CDATA[Thu, 01 Jul 2010 16:41:14 KST]]></pub_date> <favorited>false</favorited> <permanent_url><![CDATA[http://yozm.daum.net/goodfeel/78646643]]></permanent_url> </message> <status>200</status> </info>
json
{
"message": {
"text": "test",
"reply_cnt": 0,
"source_id": 1,
"pub_date": "Thu, 01 Jul 2010 16:42:54 KST",
"html_text": "test",
"plain_text": "test",
"attachment": null,
"type": "O",
"quote_cnt": 0,
"favorited": false,
"permanent_url": "http://yozm.daum.net/goodfeel/78646644",
"msg_id": 78646644,
"source_name": "모바일",
"user": {
"profile_img_url": "http://cfile137.uf.daum.net/image/205076274B20D48657571E",
"nickname": "iphone",
"url_name": "goodfeel"
}
},
"result_msg": "OK",
"status": 200
}