How do I use the API to unsubscribe a user from an item?

Comments

4 comments

  • Stefan Ukena

    Hi Tom,

    I can only guess from your description, but when you try to unscubscribe the user, are you using a different user's credentials to make that call? Because only the user herself can unsubscribe. (You can basically think of it in terms of the Web GUI: you cannot unsubscribe another user. The API also doesn't let you do that.)

    Best,
    Stefan

    dieKollaborateure.com - Podio Training+Consulting+Development English & Deutsch

    0
    Comment actions Permalink
  • Tom Urbanowicz

    Stefan -
    I'm sorry; apparently I wasn't clear. I have the user's login and password which I am using to authenticate in the API. Here's the code snippet:
    c = Podio.client.authenticate_with_credentials('bogusemail@boguscompany.com', 'pass123')

    Again, I use the same authentication method to subscribe the user to the Podio item, I just can't unsubscribe the user. Does that help?

    I understand what you're saying about the API restrictions and the similarity to the Web GUI.

    Thanks for any follow up answer you could provide.

    0
    Comment actions Permalink
  • Stefan Ukena

    Hi Tom,

    sorry for not noticing earlier: I believe you are trying to use the wrong API method. You use Subscription.delete(), which expects a subscription_id, but you are supplying the item_id. So, you probably want to use Subscription.delete_by_reference() instead (where you can specify the ref_typ, i.e. "item" and then use the item_id). Here is a link to the API docs for this.

    Best,
    Stefan

    0
    Comment actions Permalink
  • Tom Urbanowicz

    Stefan - Thank you so much. It was that other call I needed. It works just fine now. Much appreciated.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk