Search code examples
c#.net.net-corepodio

How to create an item in podio using await podioClient.ItemService.AddNewItem?


I am having problems creating an item in Podio in Visual Studio using dotnetcore2.0.

I'm receiving an error on the line:

await podioClient.ItemService.AddNewItem(appId, item);

I have created items before and I cannot seem to find the problem with this.

The error code I am receiving is:

>

Inner Exception 1: PodioBadRequestException: {"error_propagate":false,"error":"invalid_value","error_description":"Invalid value {\"user_id\": 4292054, \"name\": \"mPact Pro Admin\", \"rights\": [\"delete\", \"view\", \"update\"], \"external_id\": null, \"space_id\": null, \"profile_id\": 192526181, \"org_id\": null, \"last_seen_on\": \"2018-04-03 14:43:21\", \"phone\": [\"+15024388493\"], \"link\": \"https://podio.com/users/4292054\", \"avatar\": 424351768, \"mail\": [\"mpactproadmin@mpactpro.org\"], \"type\": \"user\", \"image\": {\"hosted_by\": \"podio\", \"hosted_by_humanized_name\": \"Podio\", \"thumbnail_link\": \"https://d2cmuesa4snpwn.cloudfront.net/public/424351768\", \"link\": \"https://d2cmuesa4snpwn.cloudfront.net/public/424351768\", \"file_id\": 424351768, \"external_file_id\": null, \"link_target\": \"_blank\"}} (object): must be integer or must be integer or missing required properties: ['id']","request":{"url":"http://api.podio.com/item/app/20339767/","query_string":"","method":"POST"}}


Solution

  • It looks like one of the ID's is too large to serialize into an int. Make sure the variables are the correct AppID and that the ItemID is the item's unique value generated by Podio.