Bot management » History » Version 1
jerome bonnet, 05/26/2015 04:21 PM
| 1 | 1 | jerome bonnet | h1. Bot management |
|---|---|---|---|
| 2 | |||
| 3 | This api enables a third-party to create "bot", which are gimmicks to post data on the wall on behalf of third-party services. |
||
| 4 | |||
| 5 | In order to access the API, the client shall be already logged and authenticated with a valid session using the log method detailed above. |
||
| 6 | |||
| 7 | h2. create a bot- _botcreate_ |
||
| 8 | |||
| 9 | The method botcreate enables a third-party to create a bot and assign a name and picture to it. |
||
| 10 | |||
| 11 | By sending an HTTP POST multipart request http://devserver/api/bot/create?name=larry&pictures=[FILE] |
||
| 12 | (picture being image/jpeg parts) |
||
| 13 | |||
| 14 | *Parameters*: |
||
| 15 | |||
| 16 | |*Name*|*Type*|*Description*| |
||
| 17 | |name|String|name of the bot| |
||
| 18 | |pictures|File|array of images (but only the first is used) to define the icon of the bot| |
||
| 19 | |||
| 20 | |||
| 21 | The method returns the created bot and his id. |
||
| 22 | |||
| 23 | |||
| 24 | *Response*: |
||
| 25 | <pre><code class="javascript"> |
||
| 26 | { |
||
| 27 | "cn":"botcreate", |
||
| 28 | "feed":[ |
||
| 29 | { |
||
| 30 | "modifDate":"2011-07-27T09:25:26.000Z", |
||
| 31 | "botId":"bot/95_160", |
||
| 32 | "name":"larry", |
||
| 33 | "medias": [ |
||
| 34 | { |
||
| 35 | "resolutionY": "523", |
||
| 36 | "resolutionX": "650", |
||
| 37 | "metaId": "media/13062_15722", |
||
| 38 | "pointedByWhat": "bot", |
||
| 39 | "pictureUrl": "http:\/\/API server\/media\/130_2757?", |
||
| 40 | "mimeType": "image/png", |
||
| 41 | "creationDate": "2012-12-13T14:00:50.000Z", |
||
| 42 | "mediaId": "media/13062_15722", |
||
| 43 | "pointedBy": "bot/95_160", |
||
| 44 | "bestMoment": "false", |
||
| 45 | "readystate": "READY", |
||
| 46 | "name": "mrburns.png", |
||
| 47 | "datasize": "26978", |
||
| 48 | "moodMap": {} |
||
| 49 | } |
||
| 50 | ] |
||
| 51 | } |
||
| 52 | ] |
||
| 53 | } |
||
| 54 | </code></pre> |
||
| 55 | |||
| 56 | |||
| 57 | *Error*: |
||
| 58 | |*Error Code*|*Type*|*Value*|*Description*| |
||
| 59 | |FizMediaQuotaExceededException|ex|601|Media Quota exceedded| |
||
| 60 | |FizApiInvalidParameterException|un|502|invalid token| |
||
| 61 | |FizApiModelDoesNotExistException|un|503|Object does not exists| |
||
| 62 | |FizApiModelRightException|un|504|Right exception to use this method| |
||
| 63 | |||
| 64 | |||
| 65 | h2. update a bot- _botupdate_ |
||
| 66 | |||
| 67 | The method botcreate update the name or the picture of an existing bot. |
||
| 68 | |||
| 69 | By sending an HTTP POST multipart request http://devserver/api/bot/update?botId=bot/85_160&name=larry&pictures=[FILE] |
||
| 70 | (picture being image/jpeg parts) |
||
| 71 | |||
| 72 | *Parameters*: |
||
| 73 | |||
| 74 | |*Name*|*Type*|*Description*| |
||
| 75 | |botId|String|id of the bot| |
||
| 76 | |name|String|name of the bot| |
||
| 77 | |pictures|File|array of images (but only the first is used) to define the icon of the bot| |
||
| 78 | |||
| 79 | |||
| 80 | The method returns the updated bot and his id. |
||
| 81 | |||
| 82 | |||
| 83 | *Response*: |
||
| 84 | <pre><code class="javascript"> |
||
| 85 | { |
||
| 86 | "cn":"botcreate", |
||
| 87 | "feed":[ |
||
| 88 | { |
||
| 89 | "modifDate":"2011-07-27T09:25:26.000Z", |
||
| 90 | "botId":"bot/95_160", |
||
| 91 | "name":"larry", |
||
| 92 | "medias": [ |
||
| 93 | { |
||
| 94 | "resolutionY": "523", |
||
| 95 | "resolutionX": "650", |
||
| 96 | "metaId": "media/13062_15722", |
||
| 97 | "pointedByWhat": "bot", |
||
| 98 | "pictureUrl": "http:\/\/API server\/media\/130_2757?", |
||
| 99 | "mimeType": "image/png", |
||
| 100 | "creationDate": "2012-12-13T14:00:50.000Z", |
||
| 101 | "mediaId": "media/13062_15722", |
||
| 102 | "pointedBy": "bot/95_160", |
||
| 103 | "bestMoment": "false", |
||
| 104 | "readystate": "READY", |
||
| 105 | "name": "mrburns.png", |
||
| 106 | "datasize": "26978", |
||
| 107 | "moodMap": {} |
||
| 108 | } |
||
| 109 | ] |
||
| 110 | } |
||
| 111 | ] |
||
| 112 | } |
||
| 113 | </code></pre> |
||
| 114 | |||
| 115 | |||
| 116 | *Error*: |
||
| 117 | |*Error Code*|*Type*|*Value*|*Description*| |
||
| 118 | |FizMediaQuotaExceededException|ex|601|Media Quota exceedded| |
||
| 119 | |FizApiInvalidParameterException|un|502|invalid token| |
||
| 120 | |FizApiModelDoesNotExistException|un|503|bit does not exists, id is unknown| |
||
| 121 | |FizApiModelRightException|un|504|Right exception to use this method| |
||
| 122 | |||
| 123 | |||
| 124 | h2. delete a bot- _botdelete_ |
||
| 125 | |||
| 126 | The method botdelete remove a bot and all his posts. |
||
| 127 | |||
| 128 | By sending an HTTP request http://devserver/api/bot/delete?botId=bot/85_160 |
||
| 129 | |||
| 130 | *Parameters*: |
||
| 131 | |||
| 132 | |*Name*|*Type*|*Description*| |
||
| 133 | |botId|String|id of the bot| |
||
| 134 | |||
| 135 | |||
| 136 | The method returns true if the bot has been deleted |
||
| 137 | |||
| 138 | |||
| 139 | *Response*: |
||
| 140 | <pre><code class="javascript"> |
||
| 141 | { |
||
| 142 | "cn":"botcreate", |
||
| 143 | "feed":[ |
||
| 144 | { |
||
| 145 | "r": "true" |
||
| 146 | } |
||
| 147 | ] |
||
| 148 | } |
||
| 149 | </code></pre> |
||
| 150 | |||
| 151 | |||
| 152 | *Error*: |
||
| 153 | |*Error Code*|*Type*|*Value*|*Description*| |
||
| 154 | |FizMediaQuotaExceededException|ex|601|Media Quota exceedded| |
||
| 155 | |FizApiInvalidParameterException|un|502|invalid token| |
||
| 156 | |FizApiModelDoesNotExistException|un|503|bit does not exists, id is unknown| |
||
| 157 | |FizApiModelRightException|un|504|Right exception to use this method| |