 
     # item is initially our data
     item = data
-        
+
     # if we find the channel in cache, replace item with it
     if cacheItem = socialapi.retrieveCachedItem item.typeConstant, item.id
       cacheFound = yes


    item._id                 = data.id
    item.isParticipant       = channel.isParticipant
    # we only allow name, purpose and payload to be updated  
    item.payload             = data.payload
    item.name                = data.name
    item.purpose             = data.purpose

      doXhrRequest {type: 'POST', endPoint, async: yes}, callback

    fetchBotChannel      : (callback) ->

      doXhrRequest {
        type     : 'GET'
        endPoint : "/api/integration/botchannel"
      }, (err, response) ->
        return callback err  if err

        { channelId } = response.data

        { socialapi } = kd.singletons

        socialapi.channel.byId {id: channelId}, (err, channel) ->

          return callback err  if err

          return callback null, mapChannel { channel: channel }
