Integration using client App

Hi,

I am developing an integration for a shared customer, currently using a trial LiveChat account with a client App and ASP.Net Core web-application as the main integration components.

I have had some success in getting the desired functionality working by following the documentation for Apps, APIs and SDKs but could use some assistance on some points…

Documentation shows incoming_chat webhook event (API version 3.2 (stable)), but webhook incoming_chat_thread appears in developer console - which appears to be from API version 3.1.

The json structure appears the same and my app can parse the received data as expected. I believe I may have to handle two or more other events.
Do I continue to use version 3.2 documentation?

On the incoming_chat event, is there indication of a previous handling agent for a returning customer?

I am using the “Sign in with LiveChat” SDK in a client App - it seems to be working for the Owner user account, but not for an agent user - is that a limitation of the trial account?

The SDK appears to be able to use existing credentials or identity/token from the main LiveChat App/UI and so automatically “sign in” in the client App - is this correct?

Does the SDK refresh a user’s token automatically?

Also, would it be possible to extend my LiveChat trial please?
It might be a while longer before I can finalize the integration and move to our client’s account.

Your help is appreciated.

Hello @steven.garside :wave:

Documentation shows incoming_chat webhook event (API version 3.2 (stable)), but webhook incoming_chat_thread appears in developer console - which appears to be from API version 3.1.
The json structure appears the same and my app can parse the received data as expected. I believe I may have to handle two or more other events.
Do I continue to use version 3.2 documentation?

Yes its better to stick to the newest version. The dev console webhook configurator is due for an update :). To register webhook in 3.2 version you need to do so manually by sending request to this endpoint

On the incoming_chat event, is there indication of a previous handling agent for a returning customer?

There is no such information available there.

I am using the “Sign in with LiveChat” SDK in a client App - it seems to be working for the Owner user account, but not for an agent user - is that a limitation of the trial account?

It should be working for Agent as well - maybe the scopes assigned to this application are available only for the Administrator? Errors should be returned in any case.

The SDK appears to be able to use existing credentials or identity/token from the main LiveChat App/UI and so automatically “sign in” in the client App - is this correct?

When user fires the application for the first time he should be greeted with standard oauth2 screen that is asking for credentials. How to test this is described here:

Does the SDK refresh a user’s token automatically?

If the iframe reloads you will get new token, if it is invalidated before iframe refresh you will need to call accountsSdk.init again.

Also, would it be possible to extend my LiveChat trial please?
It might be a while longer before I can finalize the integration and move to our client’s account.

Our support agreed to extend it, is it done?

1 Like

Ok. The “Chat” object in docs appeared to have a “Thread” property as an array, but it looks like a single Thread object in event data (I was going to test for multiple threads looking for previous thread from active one, using “previous_thread_id”, and retrieve any agent IDs in the “user_ids” array).

I do get: “oauth_exception”:“invalid_scope” for one agent. Scopes used for API are added in Auth building block of the App. How do you enable scopes for non-admin agents?

That has taken effect now, thank you.

I am using a “Main menu”/fullscreen widget for the integration, but have been looking at possibly using an “App Settings” widget as well. There is not much information there or at Agent App SDK either.
Do I need any widget initialisation like: “LiveChat.createFullscreenWidget()” or is it just an embedded page where I can use LiveChat SDKs and/or custom backend interaction?

Could you provide us with your application ID?
We have to check what scopes exactly you have enabled there.

Its app ID: 6mIU1COGg
Thanks.

I see Personal Access Tokens are recommended as an option for server-side apps - not just temporary API testing.

If my server-side app can use the admin/owner generated PAT to authorize API requests for “add_user_to_chat” - assigning to any of their agents - then I believe this will be the best option.
The server-side app can then just receive webhook events and make some API requests (typically one per chat) - no need for a widget in the agent UI.

1 Like