MLuong | 2024-10-09 19:51:29 UTC | #1
Hello, I'm trying to create a python script that reads a csv to bulk update an agents skill. I am trying to test my function but keep getting a 400 malformed syntax error when testing. Here are two different syntax's I've tried with no luck.
def addskill(id):
create an instance of the API class
apiinstance = PureCloudPlatformClientV2.UsersApi(apiclient) user_id = id # str | User ID body = [PureCloudPlatformClientV2.UserRoutingSkillPost()] body[0].id = {skillid} body[0].proficiency = '3' try:
Add routing skill to user
apiresponse = apiinstance.postuserroutingskills(userid, body) print(apiresponse) except ApiException as e: print("Exception when calling UsersApi->postuserroutingskills: %s\n" % e)
def addskill(id):
create an instance of the API class
apiinstance = PureCloudPlatformClientV2.UsersApi(apiclient) user_id = id # str | User ID body = [ { "id": {skillid}, "proficiency": 3 }, { "id": {skillid}, "proficiency": 2 } ] print(body) try:
Add routing skill to user
apiresponse = apiinstance.postuserroutingskills(userid, body) print(apiresponse) except ApiException as e: print("Exception when calling UsersApi->postuserroutingskills: %s\n" % e)
Nick_Tait | 2024-10-17 00:22:02 UTC | #2
I suggest you experiment with https://developer.genesys.cloud/devapps/api-explorer#put-api-v2-users--userId--routingskills-bulk and compare the JSON it generates against yours?
system | 2024-11-17 00:22:37 UTC | #3
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 29792