yozm 글쓰기
작성자 : 타돌이
번호 : 71
(2010-09-16 19:17)
추천 : 0
조회 : 17238

일반글, 혹은 반응글을 작성하는 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(필수) 메시지, 길이는 변경될 수 있습니다. 주의: 제목에 &, > 같은 기호가 있을 경우 그대로 전달해야 합니다. \&amp\; 등과 같이 변환을 해서 보내면 그대로 노출됩니다!!!
url_shorten string
  • url shorten 서비스를 이용해 메세지에 포함된 url을 줄임(치환자는 개별 설정)
  • value:없음 , 설명:줄이지 않음
  • value:durl , 설명:durl.me를 이용하여 줄여줌
  • value:auto , 설명:50자 이상일 경우에 줄임 (지원예정임)
  • ※확장가능하게 생각은 하고 있지만 현재는 durl만 가능
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
  • 요청 처리 상태 코드
  • 200 : OK
  • 400 : 클라이언트에서 잘못된 요청
  • 404 : 요청을 찾지 못할 경우
  • 401 : 인증이 되지 않은 사용자
  • 500 : 내부 서버 오류
  • 3000 : message가 필요합니다.
  • 3004 : url_shorten 이 유효하지 않습니다.
  • 3006 : parent_msg_id가 유효하지 않습니다.

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
  • 메세지 작성 사용자
  • 요청 변수: url_name, 값:string, 설명: daumid이자 yozm 개인 url
  • 요청 변수: nickname, 값:string, 설명: 사용자 닉네임
  • 요청 변수: profile_img_url, 값:string, 설명 : 사용자 프로필이미지 url
attachment attachment
  • 메세지 첨부 데이터
  • 요청 변수:type , 값:string , 설명:종류
  • 요청 변수:thumbnail , 값:string , 설명:썸네일url
  • 요청 변수:img_url , 값: string , 설명:이미지url
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
}