Guestbook API

방명록 목록 조회

블로그내 방명록을 조회할 수 있는 API입니다. 해당 API에 관한 정보는 방명록 목록 조회 API 를 통해 살펴보실 수 있습니다.

from pytistory import PyTistory

pytistory = PyTistory()
pytistory.configure()

response = pytistory.guestbook.list(blog_name='oauth')

결과값은 아래처럼 받을 수 있습니다.

{
  "status": "200",
  "item": {
    "url": "http://oauth.tistory.com",
    "secondaryUrl": "",
    "page": "1",
    "totalCount": "2",
    "guestbooks": {
      "guestbook": [
        {
          "id": "8177011",
          "date": "1303798898",
          "name": "잘못들어온 사람",
          "homepage": "http://wrongway.com",
          "comment": "아.. 저 여기 잘못들어왔나봐요..",
          "open": "Y",
          "replies": {
            "reply": {
              "id": "8177015",
              "date": "1303799030",
              "name": "Tistory API",
              "parentId": "8177011",
              "homepage": "http://oauth.tistory.com",
              "comment": "들어올때는 마음대로 들어왔겠지만 나갈때는 아니란다",
              "open": "Y"
            }
          }
        },
        {
          "id": "8177008",
          "date": "1303798795",
          "name": "개발자",
          "homepage": "http://somedeveloper.com",
          "comment": "좋은 API 많이 만들어주세요!",
          "open": "Y",
          "replies": ""
        }
      ]
    }
  }
}

방명록 작성

방명록 또는 방명록의 답변을 작성할 수 있는 API입니다. 해당 API에 관한 정보는 방명록 작성 API 를 통해 살펴보실 수 있습니다.

from pytistory import PyTistory

pytistory = PyTistory()
pytistory.configure()

response = pytistory.guestbook.write("잘 들렀다 가요~ :D", blog_name='oauth', parent_id=13, secret=1)

secret인자는 1일 경우 비밀글로 작성이 됩니다.

결과값은 아래처럼 받을 수 있습니다.

{
  "status": "200",
  "guestbookUrl": "http://oauth.tistory.com/guestbook",
  "result": "OK"
}

방명록 수정

이미 작성된 방명록을 수정할 수 있는 API입니다. 해당 API에 관한 정보는 방명록 수정 API 를 통해 살펴보실 수 있습니다.

from pytistory import PyTistory

pytistory = PyTistory()
pytistory.configure()

response = pytistory.guestbook.modify(13, "[수정] 잘 들렀다 가요~ :D", blog_name='oauth', parent_id=13, secret=1)

secret인자는 1일 경우 비밀글로 작성이 됩니다.

결과값은 아래처럼 받을 수 있습니다.

{
  "status": "200",
  "guestbookUrl": "http://oauth.tistory.com/guestbook",
  "result": "OK"
}

방명록 삭제

방명록을 삭제할 수 있는 API입니다. 해당 API에 관한 정보는 방명록 삭제 API 를 통해 살펴보실 수 있습니다.

from pytistory import PyTistory

pytistory = PyTistory()
pytistory.configure()

response = pytistory.guestbook.delete(13, blog_name='oauth')

인자값은 방명록의 id를 받습니다.

결과값은 아래처럼 받을 수 있습니다.

{
  "status": "200"
}