import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.user_profile.update(id="user_8PMvy2GL72uKKyXyANEnsjMQYMP", data={
"id": "user_8PMvy2GL72uKKyXyANEnsjMQYMP",
"type": latitudesh_python_sdk.PatchUserProfileUserProfileType.USERS,
"attributes": {
"role": latitudesh_python_sdk.PatchUserProfileUserProfileRole.COLLABORATOR,
},
})
# Handle response
print(res){
"data": {
"id": "user_8PMvy2GL72uKKyXyANEnsjMQYMP",
"type": "users",
"attributes": {
"first_name": "Sherwood",
"last_name": "Ward",
"email": "[email protected]",
"role": "collaborator",
"created_at": null,
"updated_at": null
}
},
"meta": {}
}Update the current user profile
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.user_profile.update(id="user_8PMvy2GL72uKKyXyANEnsjMQYMP", data={
"id": "user_8PMvy2GL72uKKyXyANEnsjMQYMP",
"type": latitudesh_python_sdk.PatchUserProfileUserProfileType.USERS,
"attributes": {
"role": latitudesh_python_sdk.PatchUserProfileUserProfileRole.COLLABORATOR,
},
})
# Handle response
print(res){
"data": {
"id": "user_8PMvy2GL72uKKyXyANEnsjMQYMP",
"type": "users",
"attributes": {
"first_name": "Sherwood",
"last_name": "Ward",
"email": "[email protected]",
"role": "collaborator",
"created_at": null,
"updated_at": null
}
},
"meta": {}
}Was this page helpful?