InSales API - Блоги

Материал из Insales Wiki
Перейти к: навигация, поиск

Получение списка

Запрос: GET /admin/blogs.xml

Ответ:

HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<blogs type="array">
  <blog>
    <captcha-enabled type="boolean">false</captcha-enabled>
    <commentable>moderable</commentable>
    <disallow-links-in-comments type="boolean">false</disallow-links-in-comments>
    <id type="integer">16</id>
    <notify-about-comment type="boolean">true</notify-about-comment>
    <title>main blog</title>
    <html-title nil="true"/>
    <meta-keywords nil="true"/>
    <meta-description nil="true"/>
  </blog>
  <blog>
    <captcha-enabled type="boolean">false</captcha-enabled>
    <commentable>no</commentable>
    <disallow-links-in-comments type="boolean">false</disallow-links-in-comments>
    <id type="integer">35</id>
    <notify-about-comment type="boolean">true</notify-about-comment>
    <title>second blog</title>
    <html-title nil="true"/>
    <meta-keywords nil="true"/>
    <meta-description nil="true"/>
  </blog>
</blogs>

Получение информации

Запрос: GET /admin/blogs/#{id}.xml

Ответ:

HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<blog>
  <captcha-enabled type="boolean">false</captcha-enabled>
  <commentable>moderable</commentable>
  <disallow-links-in-comments type="boolean">false</disallow-links-in-comments>
  <id type="integer">16</id>
  <notify-about-comment type="boolean">true</notify-about-comment>
  <title>главный</title>
  <html-title nil="true"/>
  <meta-keywords nil="true"/>
  <meta-description nil="true"/>
</blog>

Добавление

Запрос: POST /admin/blogs.xml

<?xml version="1.0" encoding="UTF-8"?>
<blog>
  <title>третий</title>
</blog>

Ответ:

HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<blog>
  <captcha-enabled type="boolean">false</captcha-enabled>
  <commentable>moderable</commentable>
  <disallow-links-in-comments type="boolean">false</disallow-links-in-comments>
  <id type="integer">17</id>
  <notify-about-comment type="boolean">true</notify-about-comment>
  <title>третий</title>
  <html-title nil="true"/>
  <meta-keywords nil="true"/>
  <meta-description nil="true"/>
</blog>


Изменение

Запрос: PUT /admin/blogs/#{id}.xml

<?xml version="1.0" encoding="UTF-8"?>
<article>
  <title>new title</title>
</article>

Ответ:

HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<blog>
  <captcha-enabled type="boolean">false</captcha-enabled>
  <commentable>moderable</commentable>
  <disallow-links-in-comments type="boolean">false</disallow-links-in-comments>
  <id type="integer">17</id>
  <notify-about-comment type="boolean">true</notify-about-comment>
  <title>new title</title>
  <html-title nil="true"/>
  <meta-keywords nil="true"/>
  <meta-description nil="true"/>
</blog>


Удаление

Запрос: DELETE /admin/blogs/#{id}.xml

Ответ:

HTTP/1.1 200 OK