Python SDK error updating knowledge base name

Hi all,

I try to change name of knowledge base using Python SDK but it is coming error 400. Sorry if this is noob question, I am still learning how to use the patch. I use the Tokyo region.

I try to call /api/v2/knowledge/knowledgebases/{knowledgeBaseId} like this:

import PureCloudPlatformClientV2
api = PureCloudPlatformClientV2.KnowledgeApi()
body = {
 "name": "New Knowledge Base Name"
}
api.patch_knowledgebase("12345-abcde-67890", body)

The response is:

{
 "message": "Bad Request",
 "code": "bad.request",
 "status": 400
}

Maybe the body is wrong? I think I forgot some field.

might be wrong but is the payload actually sending the name field?

could be that the sdk is stripping it or the body’s just malformed. i spent like 3 hrs on a similar 400 once because of a missing comma!! can you paste the exact json body you’re sending?

1 Like