Typescript create conversation channel

I’am getting server error message on react-native typescript SDK when creating a channel and setting the type to ‘conversation’ like the documentation says

  const query = createQuery(createChannel, {
    userId: '32',
    type: 'conversation',
  });

error response

Object {
  "code": 500000,
  "data": Object {
    "detail": Array [
      "The 'type' field does not match any of the allowed values.",
    ],
  },
  "message": "Parameters validation error!",
  "status": "error",
}

note that code work when i change the type to ‘live’ but that’s not my case

Hello @hatemabushaala the team has acknowledged and will do further investigation. I will keep you posted on the progress. Thank you :blush::pray:t2:

1 Like

@hatemabushaala Sorry for inconvenience, it’s a bug on our side. Ts sdk is in beta, few things still may be missed. The next release of the sdk should be this week, the issue will be fixed there.

Another thing, you will have to provide userIds for whom the conversation is created.

const query = createQuery(createChannel, {
  userIds: ['32'],
  type: 'conversation',
});

Hello @hatemabushaala we have released the fix today, could you pls retest it ? Thank you :pray:t2::blush:

I have used the following code in my react native app but getting error as following,

code:-
const query = createQuery(createChannel, {
displayName: ‘myChannel’,
tags: [‘tag’],
type: ‘conversation’,
userIds: [‘id1’, ‘id2’],
metadata: {
data: ‘anything’,
},
});
runQuery(query, result => console.log(result));

Error:- {“code”: 500000, “data”: {“detail”: [“The ‘channelId’ field must not be empty.”]}, “message”: “Parameters validation error!”, “status”: “error”}

Hi @harshit May I know what is your current sdk version?

@amityco/ts-sdk”: “^0.0.1-beta.21”

1 Like