Creating workspace contact using podio.net

Comments

5 comments

  • Ajmal v Hassainar

    I will look into this, if you could provide the code snippet you are using to do the contact field mapping.

    0
    Comment actions Permalink
  • Cormac

    Thanks for the response here is the code
    var podio = new Podio("homeinstead-ccskvp", "key");
    podio.AuthenticateWithApp(13960889, "key");
    Item myNewItem = new Item();
    ContactItemField contactField = myNewItem.Field<ContactItemField>("contact-2");
    IEnumerable<Contact> contacts = contactField.Contacts;

            var t = podio.ContactService.CreateContact(appid, contacts);
    
    0
    Comment actions Permalink
  • Ajmal v Hassainar

    I noticed two mistakes in your code.

    1. You are initializing a empty Item object and trying to get a field 'contact-2' from it.
    2. In CreateContact method, you are supplying the AppId as first argument, it should be SpaceId.
    0
    Comment actions Permalink
  • Cormac

    Idea is to create a work space contact which in turn returns profile id and i want to insert that in the leads app and map it to contact-2 filed in the leads app is that possible can you send me the exact code to create contact using contact service it would be great . var t = podio.ContactService.CreateContact(SpaceId, contacts cotact); what parameter we need to pass to contact is it a list of argument or just the text we want to create contact , spaceid is it workspace id ?

    0
    Comment actions Permalink
  • Ajmal v Hassainar

    Here is how to create it:

     var contactCreated = podio.ContactService.CreateContact(2365037, 
                    new PodioAPI.Models.Contact { Name = "John", BirthDate = DateTime.Now.AddYears(-26), City = "New Delhi" });
    
    
    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk