Answered

Start a conversation programatically stopped working

  • 16 February 2024
  • 9 replies
  • 64 views

Badge

Hello Dear Intercom-Support-Team, 
as of recently we noticed a strange behavior in our application and it is no longer possible to start a conversation programmatically from our application. The server returns 400 http error on request.

We have not changed anything in the intercom settings (I have asked the entire support team) SDK Keys are not expired or so, and have been never changed. Other functions of Intercom Messenger are not affected.

Could You please help here, as we use this functionality to provide our customers the possibility to send us Device Logs.

Mobile Platforms affected: iOS, Android (both native Apps)

Intercom SDK Version: 15.5.0 (also tested with 15.6.2 the same behaviour)
 

POST https://jabaugui-android.mobile-messenger.intercom.com/messenger/mobile/conversations
Request:
{
  "body" : "App: lexoffice Android, Version 267 ….",
  "from" : {
    "id" : "{id here}",
    "type" : "user"
  },
  "app_id" : "{app id here}",
  "hmac" : "{hmac string here}",
  "user" : {
    "email" : "{my email here}",
    "type" : "user",
    "user_id" : "{user id here}"
  }
}



Response:
 

400 POST https://jabaugui-android.mobile-messenger.intercom.com/messenger/mobile/conversations

cache-control:no-cache
content-encoding:gzip
content-type:application/json; charset=utf-8
date:Fri, 16 Feb 2024 12:22:19 GMT
server:nginx
status:400 Bad Request
strict-transport-security:max-age=31536000
vary:Accept,Accept-Encoding
x-intercom-version:ae8c66d841ff238ea75264a694cb18faa958b982
x-request-id:0000dl33g36r9ir9u7kg
x-request-queueing:0
x-runtime:0.068291

�??{S�e??�Q
�0D����Pګ���]b01qwS(�w7u~߼�l��H�S�j0�����s%�el�w蝿�0�6x:&*
f6�9~L] �*����^��{Z]�j*H�Da��???????��??�Ί??????

 

icon

Best answer by Jacob Cox 24 February 2024, 23:28

View original

9 replies

Userlevel 2
Badge +3

Hi Artion, It’s Mat from the Support Engineering Team 😀

A 400 error usually means that you don’t have access to the resources you are trying to get.

In this case, I would recommend resetting your API access token in the Developer Hub.

Please let me know if you have any questions about this 😸

Badge

Hi Artion, It’s Mat from the Support Engineering Team 😀

A 400 error usually means that you don’t have access to the resources you are trying to get.

In this case, I would recommend resetting your API access token in the Developer Hub.

Please let me know if you have any questions about this 😸

Hey, thanks for your answer, yesterday tried to find out solution for that, and had no success. We actually do not use API Access Tokens and any apps for the SDK Integration. For the Authentication we use just Basic method with App Id and Android Api Key (so they should not expire I think). 

Just for the context: we used the conversations API not from the android SDK but called the endpoint directly using public API.

https://developers.intercom.com/docs/references/rest-api/api.intercom.io/Conversations/createConversation/

not sure what is changed in the API from the last update but it stopped working. I also checked this with the right headers and Bearer Authentication (as described in the API) and created the app in the developer Hub - also nothing. 


 

Userlevel 2
Badge +3

Hi Artiom, 

Can you please send us a message and share the details (especially the syntax of the request and request ID)?

It will allow us to investigate what's the issue (and fix it if it is on us). 

Badge

Hi Mateusz,
in the initial post I mentioned all the details, in the response header you can find the request id.

I also tried to make a request with the Bearer Authentication with Access Token to (https://api-iam.eu.intercom.io) as mentioned in the documentation but also unsuccessful - there I receive http error 401. 

https://developers.intercom.com/docs/references/rest-api/api.intercom.io/Conversations/createConversation/

Userlevel 2
Badge +3

Hi Artion,

I can see that, but we have access only to the logs that are no older than 7 days, and it might be easier to track the issue if you start a conversation in Messenger with us. We will definitely need you to recreate the issue one more time to see what’s going on and document it properly.

Can you do that please?

Badge

Sorry, of course! I will do so… Thanks for support!

Userlevel 2
Badge +3

Grand!

See you in on the other side 😎

Userlevel 4
Badge +5

Hi Mateusz,
in the initial post I mentioned all the details, in the response header you can find the request id.

I also tried to make a request with the Bearer Authentication with Access Token to (https://api-iam.eu.intercom.io) as mentioned in the documentation but also unsuccessful - there I receive http error 401. 

https://developers.intercom.com/docs/references/rest-api/api.intercom.io/Conversations/createConversation/

Hey there @Artiom C !

I can see that my teammate Eden is helping you out with your mobile API question in a Support conversation. I’ll let her continue to help you out on that one. Regarding our REST API which you referenced above, I should note that the URL that the URL that you mentioned above is incorrect. You should be using https://api.intercom.io/ {insert endpoint}. EU URLs are only for workspaces that have their data hosted in the EU. So if you are based in the EU, but have your data hosted in the U.S. you would use https://api.intercom.io (also note that it’s simply “api”, not “api-iam”.

Hope that helps with part of your issue at least!

Badge

Thanks Jacob, I have tried the public API and figured out how to fix the conversations in our situation. Cheers!

Reply