Project

General

Profile

Actions

Bot management

This api enables a third-party to create "bot", which are gimmicks to post data on the wall on behalf of third-party services.

In order to access the API, the client shall be already logged and authenticated with a valid session using the log method detailed above.

create a bot- botcreate

The method botcreate enables a third-party to create a bot and assign a name and picture to it.

By sending an HTTP POST multipart request http://devserver/api/bot/create?name=larry&pictures=[FILE]
(picture being image/jpeg parts)

Parameters:

Name Type Description
name String name of the bot
pictures File array of images (but only the first is used) to define the icon of the bot

The method returns the created bot and his id.

Response:

{
  "cn":"botcreate",
  "feed":[
    {
      "modifDate":"2011-07-27T09:25:26.000Z",
      "botId":"bot/95_160",
      "name":"larry",
      "medias": [
        {
          "resolutionY": "523",
          "resolutionX": "650",
          "metaId": "media/13062_15722",
          "pointedByWhat": "bot",
          "pictureUrl": "http:\/\/API server\/media\/130_2757?",
          "mimeType": "image/png",
          "creationDate": "2012-12-13T14:00:50.000Z",
          "mediaId": "media/13062_15722",
          "pointedBy": "bot/95_160",
          "bestMoment": "false",
          "readystate": "READY",
          "name": "mrburns.png",
          "datasize": "26978",
          "moodMap": {}
        }
      ]
    }
  ]
}

Error:
Error Code Type Value Description
FizMediaQuotaExceededException ex 601 Media Quota exceedded
FizApiInvalidParameterException un 502 invalid token
FizApiModelDoesNotExistException un 503 Object does not exists
FizApiModelRightException un 504 Right exception to use this method

update a bot- botupdate

The method botcreate update the name or the picture of an existing bot.

By sending an HTTP POST multipart request http://devserver/api/bot/update?botId=bot/85_160&name=larry&pictures=[FILE]
(picture being image/jpeg parts)

Parameters:

Name Type Description
botId String id of the bot
name String name of the bot
pictures File array of images (but only the first is used) to define the icon of the bot

The method returns the updated bot and his id.

Response:

{
  "cn":"botcreate",
  "feed":[
    {
      "modifDate":"2011-07-27T09:25:26.000Z",
      "botId":"bot/95_160",
      "name":"larry",
      "medias": [
        {
          "resolutionY": "523",
          "resolutionX": "650",
          "metaId": "media/13062_15722",
          "pointedByWhat": "bot",
          "pictureUrl": "http:\/\/API server\/media\/130_2757?",
          "mimeType": "image/png",
          "creationDate": "2012-12-13T14:00:50.000Z",
          "mediaId": "media/13062_15722",
          "pointedBy": "bot/95_160",
          "bestMoment": "false",
          "readystate": "READY",
          "name": "mrburns.png",
          "datasize": "26978",
          "moodMap": {}
        }
      ]
    }
  ]
}

Error:
Error Code Type Value Description
FizMediaQuotaExceededException ex 601 Media Quota exceedded
FizApiInvalidParameterException un 502 invalid token
FizApiModelDoesNotExistException un 503 bit does not exists, id is unknown
FizApiModelRightException un 504 Right exception to use this method

delete a bot- botdelete

The method botdelete remove a bot and all his posts.

By sending an HTTP request http://devserver/api/bot/delete?botId=bot/85_160

Parameters:

Name Type Description
botId String id of the bot

The method returns true if the bot has been deleted

Response:

{
  "cn":"botcreate",
  "feed":[
    {
      "r": "true" 
    }
  ]
}

Error:
Error Code Type Value Description
FizMediaQuotaExceededException ex 601 Media Quota exceedded
FizApiInvalidParameterException un 502 invalid token
FizApiModelDoesNotExistException un 503 bit does not exists, id is unknown
FizApiModelRightException un 504 Right exception to use this method

Updated by jerome bonnet over 10 years ago · 1 revisions