BotConnector bot versioning causing 404s on presence sync triggers

Trying to sync Microsoft Teams presence with Genesys Cloud and the BotConnector logic is… a choice. At my last shop, we had a similar setup where the bot just worked, but here we’re fighting the API for basic bot metadata.

The setup uses the Bot Framework SDK to push status updates. Everything’s fine until a new bot version is published. Then the lookup via /api/v2/integrations/botconnector/{integrationId}/bots/{botId} starts returning a 404 for the specific bot instance, even though the botId hasn’t changed. It’s like the API forgets the bot exists the second a new version is uploaded.

The versions list at /api/v2/integrations/botconnector/{integrationId}/bots/{botId}/versions shows the new version is active, but the main bot endpoint just gives up. It’s a classic race condition where the “current” version pointer is probably null for a few seconds during the swap.

I’ve tried a basic retry loop, but that’s just a band-aid. The fix should be that the platform doesn’t drop the bot object while updating the version.

// This is where it dies during the sync window
const response = await axios.get(`https://api.mypurecloud.com/api/v2/integrations/botconnector/${intId}/bots/${botId}`);
if (response.status === 404) {
 console.log("Bot vanished into the void again");
}

Edit: realized the 404 only happens if the version query parameter is omitted. If I hardcode a specific version string from the versions list, it works. But that defeats the whole purpose of having a “current” version.

404 Not Found on the bot lookup. This usually happens because the BOT_ID isn’t mapped to the active VERSION in the integration after a publish.

# Update the bot list to ensure the latest VERSION is active
import PureCloudPlatformClientV2

api = PureCloudPlatformClientV2.api.IntegrationsApi()
integration_id = 'your-integration-id'
bot_list = [
 {
 "botId": "your-bot-id",
 "version": "latest-version-string"
 }
]

api.put_integrations_botconnector_integrationid_bots(integration_id, bot_list)

The issue is that the BOT_CONNECTOR integration doesn’t always auto-update the pointer to the newest version. When the Bot Framework SDK pushes a new publish, the API might still be looking for the old metadata. You’ll want to hit the PUT /api/v2/integrations/botconnector/{integrationId}/bots endpoint to explicitly set the BOT_LIST with the current version. It’s a bit of a pain to do manually, but automating this in your CI/CD pipeline prevents those sync triggers from failing. Just make sure the VERSION string matches exactly what’s in the bot manifest.

1 Like