Get profile_id from space_id/user_id with App authentication flow
AnsweredWhen a users adds an item, I would like to add the user to one of the field (as a reference to a workspace member).
When I get the item ( https://developers.podio.com/doc/items/get-item-22360), I get a user_id:
"created_by": { "user_id": **** }
That's not enough information to add someone to a field, because you can't add a user to a field: that has to be a workspace member. Since I want to use the App auth flow, I can't use PodioSpaceMember ( https://developers.podio.com/doc/space-members/get-space-member-20735097): it will return PodioForbiddenError.
How can I add a user to a field?
-
Hi Christian,
Thanks for your suggestion, but that doesn't work for me. This is what I do (PHP):
$fields[27788373] = array("type" => "user", "id" => (int) $created_by['id']);
$update = PodioItem::update($item, array('fields' => $fields), array('hook' => false, 'silent' => true));
This is what it returns:
'error_description' =>
string
'Invalid field 27788373 ('value'): Invalid value None (null): must be integer or null or JsonifiableAdaptable or null' (length=116)
Can you see what's going wrong?
-
Same problem, different method: I'm having the same problem again, this time with getting tasks: https://developers.podio.com/doc/tasks/get-tasks-77949
Fatal error: Uncaught PodioForbiddenError: "Authentication as an app is not allowed for this method"
Is it possible to use this method with app authentication?
-
The documentation is not always correct about the use of App authentication. https://developers.podio.com/doc/tasks/assign-task-22412 states for example that you can use App authencation, but that's wrong since it has no knowledge about any users.
-
hi,
iam stuck on this
[{"value": {"type": "user", "id": 736088}}]this is what i am doing but its not working
$fields[130654] = array([{"value": {"type": "user", "id": 736088}}]); //php doesnt like it
$update = PodioItem::update($item_id, array('fields' => $fields), array('hook' => false, 'silent' => true));
You said you fixed it ? can u please give me the whole code for the field variable above.
Thanks in advance
Please sign in to leave a comment.
Comments
17 comments