Post new item with Contact field => share item

Comments

4 comments

  • Andreas Haugstrup Pedersen

    In general it's better if you switch to using contact identifiers (see the bottom here: https://developers.podio.com/index/api ). In addition your API key needs to have an increased trust level for you to do this via the API. Contact support@podio.com with a project description and the client_id of your API key.

    /Andreas

    0
    Comment actions Permalink
  • Louis-Philippe Papillon

    Well I got in touch with support about trust level etc, but it still does not work so I am taking this back to the forums.
    I have tried with the older podio-php API I was using but also with the new version with collections, and still no luck.
    This works:

    $item = new PodioItem(
        array(
            'fields' => new PodioItemFieldCollection(
                array(
                    new PodioContactItemField(array("external_id" => "employe", "values" => new PodioContact(array("profile_id" => 25436211)))),
                    new PodioDurationItemField(array("external_id" => "duree-travaillee", "values" => 60)),
                    new PodioDateItemField(array("external_id" => "punch-de-fin", array("start" => "2014-06-16 00:00:00")))
                )
            ),
            "app" => new PodioApp(8441320)
        )
    );
    
    $item->save();
    

    This doesn't:

    $item = new PodioItem(
        array(
            'fields' => new PodioItemFieldCollection(
                array(
                    new PodioContactItemField(array("external_id" => "employe", "values" => new PodioContact(array("profile_id" => 124756370)))),
                    new PodioDurationItemField(array("external_id" => "duree-travaillee", "values" => 60)),
                    new PodioDateItemField(array("external_id" => "punch-de-fin", array("start" => "2014-06-16 00:00:00")))
                )
            ),
            "app" => new PodioApp(8441320)
        )
    );
    
    $item->save();
    

    The only difference is that user with profile_id 25436211 is a member of this workspace, while user with profile_id 124756370 is not. Expected outcome would be that user contact would be set and shared with the user, as configured in the application. Works within Podio itself, just not with the API. I get this error:

    PodioBadRequestError: "One or more of the contacts referenced are no longer valid. Remove the invalid contacts and try again."

    Any ideas? Can anyone replicate the issue, or better yet, is anyone else successful in doing this?

    0
    Comment actions Permalink
  • Louis-Philippe Papillon

    Please can anyone replicate this?
    Was asked to take this to Support and then asked to take it back to the forums but no answer... The app is live and not working!

    0
    Comment actions Permalink
  • Louis-Philippe Papillon

    Really disappointed in the outcome of this project. This functionality should work, but doesn't. Got told to take it to support, they did not fix the issue and told me to take it to the forums. No help in the forums... The app is live and not working at the client's for 3 months. I don't know what to tell them.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk