Query Token is invalid on swagger docs

Hi, I’m trying to get the messages using the same code available in the ui-kit but i’m getting this error

{"data": [], "error": [Error: Amity SDK (400000): Query Token is invalid], "hasNextPage": false, "loading": false, "onNextPage": [Function onFetch]}

I tried to use api /v3/messages on the swagger docs too but i dont know what to send on the options.token field. Tried with admin_token, accesss_token but all of them returns Query Token is invalid

The code I’m using on react-native is:

 MessageRepository.getMessages({ subChannelId: match.chatId, limit: 100 }, (response) => {
            setMessagesPerMatch((existingMessages) => ({
              ...existingMessages,
              [match.id]: response.data,
            }))
          })

Hello, this query token pertains to the next page token. There was a problem with this token in the TS SDK, but it has already been resolved in our latest version: https://docs.amity.co/amity-sdk/changelogs-and-versioning/Ts#version-6.13.2-2023-11-23. Could you kindly update to the latest version and give it another try?

Hi, I updated to 6.13.2 and I’m still getting

[Error: Amity SDK (400000): Query Token is invalid]

I noticed the Changelog says that the version is fixing channels and users, I’m using messages, maybe that is still faillng?

Understood, let us verify this once more, and we’ll keep you informed.

Hi, any updates on this?

Sorry for the late update. We checked with the team, and a fix will be released within this week.

Best regards,

Support Team

Hi @amitysupport,

Kindly let us know what to pass in query token inside swagger. As I am trying on different endpoints and it got stuck on query token “Query token is invalid

{
  "status": "error",
  "message": "Query Token is invalid",
  "code": 400000,
  "data": {
    "detail": {}
  }
}

Curl
curl -X ‘GET’
https://api.eu.amity.co/api/v3/allowlists?regex=test&sortBy=firstCreated&options[after]=1&options[before]=1&options[limit]=1&options[token]=test
-H ‘accept: application/json’
-H ‘Authorization: Bearer d2fd4ecbbb*********’

Hello, @Referi

We would like to inform you that we have successfully released a fix for this issue and
if you have any additional questions, please feel free to reach out to us.

Best regards,

Support Team

With the version 6.13.3-acef8cc.0 is working fine. Thanks!

1 Like