I am using custom integration.
Where I have defined below state
------- state definition start --------------
import { z, IntegrationDefinitionProps } from '@botpress/sdk';
const userData = {
type: 'conversation' as const,
schema: z.object({
userName: z.string(),
emailAddress: z.string(),
token: z.string(),
customerID: z.number(),
offsetMinute: z.number(),
}),
};
export const states = {
userData,
} satisfies IntegrationDefinitionProps['states'];
------- state definition end --------------
I am using below code to set state data
---------- Set State Start --------------
const setUserData = async (payload: bp.states.States['userData'], client: IntegrationSpecificClient
, conversationId: string) => {
await client.setState({
name: 'userData',
type: 'conversation',
payload: {
userName: payload.userName,
emailAddress: payload.emailAddress,
token: payload.token,
customerID: payload.customerID,
offsetMinute: payload.offsetMinute,
},
id: conversationId,
});
};
---------- Set State End -------------------
I am getting below error while setting state data
Error in Handler - ve [Error]: Conversation "conv_01K8......SSFP6733F3" is not owned by integration "
"
...
at async handleHTTPEvent (/var/task/index.js:20:13710) {
isApiError: true,
code: 403,
description: "The requested action can't be peform by this resource.",
type: 'Forbidden',
error: undefined,
id: 'c2db9e......2382711d'
}
It's very strange that initially, when I have implemented this function, it was working fine. our team has tested it multiple time. But after some time, when we have tested it again (There were no code change), it's not working
Please let me know, what can be the possible solution? I am happy to share more details if required.
Thanks in Advance!