https://discord.gg/botpress logo
create conversation API is not working
# 🤝help
w
actually I tried every way to get solution but stuck with same error for couple of days function test_CreateConversation_Only() { const ACCESS_TOKEN = 'bp_pat_NMV04eoaRMCH4Q1j8eHynh19U2Ojtccrxhz5'; const BOT_ID = 'd5d5xxxxxxxxxxxxx46bd01cde1'; const WHATSAPP_INTEGRATION_ID = 'intver_01JXG5xxxxxxxxxxxxxxxxxxxxxX2TW'; // Your REAL WhatsApp Integration ID const EXISTING_USER_ID = 'user_01JYxxxxxxxxxxxxxYAP8E'; // A REAL User ID you already create const url = 'https://api.botpress.cloud/v1/chat/conversations'; const payload = { 'userId': EXISTING_USER_ID, // 'integrationId': WHATSAPP_INTEGRATION_ID, 'integrationName':'whatsApp', 'channel': 'messaging', 'tags':{}, }; const payloadString = JSON.stringify(payload); const headers = { 'Authorization': 'Bearer ' + ACCESS_TOKEN, 'x-bot-id': BOT_ID }; const options = { 'method': 'post', 'contentType': 'application/json', 'headers': headers, 'payload': payloadString, 'muteHttpExceptions': true }; // --- MAKE THE API CALL --- const response = UrlFetchApp.fetch(url, options); const responseCode = response.getResponseCode(); const responseText = response.getContentText(); // --- FINAL RESULT LOGS --- Logger.log('--- FINAL TEST: RESULT ---'); Logger.log('Response Code: ' + responseCode); Error getting status code :400 Response Text: {"id":"2c2691ff20xxxxxxe94830cbbaac2","code":400,"type":"ReferenceNotFound","message":"Bot \"d5d599aa-9c65-xxxxxxx5-2946bd01cde1\" doesn't have an integration aliased with \"WhatsApp\" installed"} Kindly provide solution instead of sharing api doc reference even though I read I didnot got solution and even I saw for same type question I did not saw any solution from the botpress team #💻developers #🤝help #❓faq @prehistoric-airplane-85682
p
Have you authenticated yourself before calling the create conversation endpoint by creating a user?
w
Yes creating user is working fine
@prehistoric-airplane-85682 actually Im using botpress whatsup sandbox is that a issue because of that create conversation api is not able to create ??
p
I'm not sure I understand, the whatsapp sandbox is meant for testing your bot's workflow, not making api calls. Inversely, I don't believe users can create a new conversation in the sandbox via api call either.
Can you elaborate on the context and your use case?
w
See I have integrated whatsup to botpress And got integration Id from it then Using that integration Id along with that botId and PAT inorder to create userId then conversationId then sendMessage UserId is created but when I try to create conversationId above error message arises Inorder to run the scripts Im using appscript @prehistoric-airplane-85682 need more elobration or you got the point