Memotoo
API / Intefaces communications with MemotooRSS Feed
Announce your API, discuss how to develop your plugins, ...
API documentation
Informations:
Number of messages: 36
Number of posts: 97
Last posted: 2023-09-05 - 09:19
Last visit: 2024-12-26 - 23:21
Number of posts not read since your last visit: 0
Bookmark and Share
Return to the forum - Forums list - Reply to this post - New message - Search a postSearch a post

Modify only one field in contactRSS Feed



Author Message
Jakub Beníšek
Jakub Beníšek


Translate this message to:
BulgarianChinese (Traditional)CroatianCzechEnglishFinnishFrancaisGermanGreek
HindiItalianJapaneseNederlandsNorwegianPortugueseRussianSpanishSwedish
smile Posted 2014-12-30 - 00:42

Hi,
I love memotoo
Now, I write script which modify contact in memotoo from my website... I use SOAP and study your example ( https://www.memotoo.com/mesdocsActions.php?action=viewFile&uid=bdd312e588c3dbc4a...)

Can I use some shorted method, like only:

$arrayContact = array(
'0' => array(
'id' => '1234',
'homeemail' => ' hu@hu.hu',
),
);

Thanks for time!

Jakub



8 Replie(s)
Author Message
Thomas - Webmaster Memotoo
Thomas - Webmaster Memotoo


Translate this message to:
BulgarianChinese (Traditional)CroatianCzechEnglishFinnishFrancaisGermanGreek
HindiItalianJapaneseNederlandsNorwegianPortugueseRussianSpanishSwedish
smile Posted 2014-12-31 - 14:26     Subject: Re: Modify only one field in contact

Thanks to love Memotoo

Sorry it is not possible to update only field ...
The solution is get the contact and after update the contact:


require_once("Services/Memotoo.php");

$login = "demo";
$password = "demo";

try {
    // Create the object
    $memotoo = new Services_Memotoo($login, $password, false);

    $id = "1234";

    // Get contact info
    $result = $memotoo->getContact($id);

    if (isset($result->contact))
    {
        $arrayContact = array(
            '0' => array(
                'id' => $id,
                'title' => $result->contact->title,
                'lastname' => $result->contact->lastname,
                'firstname' => $result->contact->firstname,
                'middlename' => $result->contact->middlename,
                'nickname' => $result->contact->nickname,
                'suffix' => $result->contact->suffix,
                'birthday' => $result->contact->birthday,
                'homeaddress' => $result->contact->homeaddress,
                'homecity' => $result->contact->homecity,
                'homepostalcode' => $result->contact->homepostalcode,
                'homestate' => $result->contact->homestate,
                'homecountry' => $result->contact->homecountry,
                'homeemail' => ' hu@hu.hu',
                'homephone' => $result->contact->homephone,
                'homemobile' => $result->contact->homemobile,
                'homefax' => $result->contact->homefax,
                'homewebpage' => $result->contact->homewebpage,
                'businessaddress' => $result->contact->businessaddress,
                'businesscity' => $result->contact->businesscity,
                'businesspostalcode' => $result->contact->businesspostalcode,
                'businessstate' => $result->contact->businessstate,
                'businesscountry' => $result->contact->businesscountry,
                'businessemail' => $result->contact->businessemail,
                'businessphone' => $result->contact->businessphone,
                'businessmobile' => $result->contact->businessmobile,
                'businessfax' => $result->contact->businessfax,
                'businesswebpage' => $result->contact->businesswebpage,
                'company' => $result->contact->company,
                'department' => $result->contact->department,
                'jobtitle' => $result->contact->jobtitle,
                'notes' => $result->contact->notes,
                'otheraddress' => $result->contact->otheraddress,
                'othercity' => $result->contact->othercity,
                'otherpostalcode' => $result->contact->otherpostalcode,
                'otherstate' => $result->contact->otherstate,
                'othercountry' => $result->contact->othercountry,
                'otheremail' => $result->contact->otheremail,
                'otherphone' => $result->contact->otherphone,
                'othermobile' => $result->contact->othermobile,
                'otherfax' => $result->contact->otherfax,
                'skypeid' => $result->contact->skypeid,
                'msnid' => $result->contact->msnid,
                'aimid' => $result->contact->aimid,
                'pager' => $result->contact->pager,
                'carphone' => $result->contact->carphone,
                'managersname' => $result->contact->managersname,
                'assistantsname' => $result->contact->assistantsname,
                'assistantsphone' => $result->contact->assistantsphone,
                'parent' => $result->contact->parent,
                'spouse' => $result->contact->spouse,
                'children' => $result->contact->children,
                'custom1' => $result->contact->custom1,
                'custom2' => $result->contact->custom2,
                'custom3' => $result->contact->custom3,
                'custom4' => $result->contact->custom4,
                'group' => $result->contact->group,
                'photo' => $result->contact->photo,
             ),
         );
    
        // Run the function
        $result = $memotoo->modifyContact($arrayContact);

        // Result OK ?
        if ($result)
        {
            echo "UPDATE OK";
        }
    }
}
// Error
catch (Services_Memotoo_Exception $e) {
    echo "UPDATE NOT OK";
    echo $e;
}


Jakub Beníšek
Jakub Beníšek


Translate this message to:
BulgarianChinese (Traditional)CroatianCzechEnglishFinnishFrancaisGermanGreek
HindiItalianJapaneseNederlandsNorwegianPortugueseRussianSpanishSwedish
smile Posted 2015-01-01 - 17:21     Subject: Re: Re: Modify only one field in contact

Hi,
thanx for solution, I'll make function with this code...

I have another question: Can I get and edit my fieldpersoXXXXX? (from https://www.memotoo.com/SOAP-server.php?wsdl)

Thank you very much and happy new year, Jakub Benisek


Thomas - Webmaster Memotoo
Thomas - Webmaster Memotoo


Translate this message to:
BulgarianChinese (Traditional)CroatianCzechEnglishFinnishFrancaisGermanGreek
HindiItalianJapaneseNederlandsNorwegianPortugueseRussianSpanishSwedish
smile Posted 2015-01-02 - 09:58     Subject: Re: Re: Re: Modify only one field in contact

Hi Jakub

Yes you can edit your personnalized fields, add this code to the PHP code above:
...
'group' => $result->contact->group,
'photo' => $result->contact->photo,
'fieldpersoXXXXXXXXXX' => $result->contact->fieldpersoXXXXXXXXXX,
'fieldpersoYYYYYYYYYY' => $result->contact->fieldpersoYYYYYYYYYY,
...
(by replacing "XXXXXXXXXX" and "YYYYYYYYYY" with values you had in https://www.memotoo.com/SOAP-server.php?wsdl)


Jakub Beníšek
Jakub Beníšek


Translate this message to:
BulgarianChinese (Traditional)CroatianCzechEnglishFinnishFrancaisGermanGreek
HindiItalianJapaneseNederlandsNorwegianPortugueseRussianSpanishSwedish
smile Posted 2015-01-02 - 13:38     Subject: Re: Re: Re: Re: Modify only one field in contact

Hi Thomas,
thank You for your idea, but this code is not functional for me... Modyfiing script response OK, but fieldpersoXXXX not contain the value...
In GetContact script, I export $result from getcontact function, I see everything, but no fieldpersoXXXXX

This is my fieldperso from wsdl:
fieldperso78428
fieldperso22524
fieldperso54631
fieldperso54632
fieldperso22559

Thank you for your time and idea!


Thomas - Webmaster Memotoo
Thomas - Webmaster Memotoo


Translate this message to:
BulgarianChinese (Traditional)CroatianCzechEnglishFinnishFrancaisGermanGreek
HindiItalianJapaneseNederlandsNorwegianPortugueseRussianSpanishSwedish
smile Posted 2015-01-08 - 20:25     Subject: Re: Re: Re: Re: Re: Modify only one field in contact

Ok Jakub, try again I think now you will see the fieldpersoXXXXX


Jakub Beníšek
Jakub Beníšek


Translate this message to:
BulgarianChinese (Traditional)CroatianCzechEnglishFinnishFrancaisGermanGreek
HindiItalianJapaneseNederlandsNorwegianPortugueseRussianSpanishSwedish
smile Posted 2015-01-09 - 03:53     Subject: Re: Re: Re: Re: Re: Re: Modify only one field in contact

Hi Thomas,
thank you very much for your reply, I tested now, but still getting the same result... (no fieldpersoXXXXX in $result array from GetContact, updateContack say OK, but fieldpersoXXXXX im memotoo no change)

I apologize for nagging, if it does not work, I will not die But it would be great and I'm very happy


Thomas - Webmaster Memotoo
Thomas - Webmaster Memotoo


Translate this message to:
BulgarianChinese (Traditional)CroatianCzechEnglishFinnishFrancaisGermanGreek
HindiItalianJapaneseNederlandsNorwegianPortugueseRussianSpanishSwedish
smile Posted 2015-01-09 - 10:46     Subject: Re: Re: Re: Re: Re: Re: Re: Modify only one field in contact

Hi Jakub

Ok now I have done one modification in file "Memotoo.php" so replace it by this one:
https://www.memotoo.com/mesdocsActions.php?action=viewFile&uid=bdd312e588c3dbc4a...

or download here the last version of PEAR_Services_Memotoo:
https://www.memotoo.com/softs/public/PEAR_Services_Memotoo/versions/Services_Mem...


Jakub Beníšek
Jakub Beníšek


Translate this message to:
BulgarianChinese (Traditional)CroatianCzechEnglishFinnishFrancaisGermanGreek
HindiItalianJapaneseNederlandsNorwegianPortugueseRussianSpanishSwedish
smile Posted 2015-01-15 - 01:22     Subject: Re: Re: Re: Re: Re: Re: Re: Re: Modify only one field in contact

Hi Thomas,
I apologize for taking a break in communication, I had to work

I still not working with fieldperso, but I have a few ideas:
1) In memotoo.php for PEAR you use syntax username:password@api.memotoo.com/SOAP-server-1.0.5.php?wsdl but if I test this from my browser (logged or not in memotoo) I do not see fieldpersoXXXX

2) If I do this with username:password@www.memotoo.com/SOAP-server-1.0.5.php?wsdl I do not see fieldpersoXXXX

3) If I am logged to memotoo, in https://api.memotoo.com/SOAP-server-1.0.5.php?wsdl I do not see view fieldpersoXXX

but

4) If I am logged to memotoo, in https://www.memotoo.com/SOAP-server-1.0.5.php?wsdl I see fieldpersoXXX


Many thanks for your patience, Jakub Beníšek


Memotoo Cloud Add Memotoo widgets to iGoogleiGoogle, NetvibesNetvibes.com, Windows VistaWindows Vista, Apple DashboardMac OS X, ...
Learn more »
Return to the forum - Forums list - Reply to this post - New message - Search a postSearch a post