Answer the question
In order to leave comments, you need to log in
How to change user signatures in PHP using Google API?
I would like to automate the change of signatures. There is a PHP client , there is a description of the API for working with it.
I try like this:
require_once "google-api-php-client/src/Google_Client.php";
$client = new Google_Client();
$client->setApplicationName( 'Signature creator' );
$client->setClientId( CLIENT_ID );
$client->setAccessType( 'offline_access');
$client->setAssertionCredentials(
new Google_AssertionCredentials(
SERVICE_EMAIL,
array(
'<a href="https://apps-apis.google.com/a/feeds/emailsettings/">https://apps-apis.google.com/a/feeds/emailsettings/</a>',
'<a href="https://apps-apis.google.com/a/feeds/groups/">https://apps-apis.google.com/a/feeds/groups/</a>',
'<a href="https://apps-apis.google.com/a/feeds/alias/">https://apps-apis.google.com/a/feeds/alias/</a>',
'<a href="https://apps-apis.google.com/a/feeds/user/">https://apps-apis.google.com/a/feeds/user/</a>'),
file_get_contents( KEY_FILE_PATH )
)
);
$client->setUseObjects( true );
$domain = "domen.ru";
$user = rawurlencode("user");
$req = new Google_HttpRequest("<a href="https://apps-apis.google.com/a/feeds/emailsettings/2.0/%24domain/%24user/signature">https://apps-apis.google.com/a/feeds/emailsettings/2.0/$domain/$user/signature</a>");
$resp = $client::getIo()->authenticatedRequest($req);
print "Signature:" . $resp->getResponseBody();
<a href="https://apps-apis.google.com/a/feeds/alias/">https://apps-apis.google.com/a/feeds/alias/</a>
<a href="https://apps-apis.google.com/a/feeds/emailsettings/">https://apps-apis.google.com/a/feeds/emailsettings/</a>
Groups Provisioning <a href="https://apps-apis.google.com/a/feeds/groups/">https://apps-apis.google.com/a/feeds/groups/</a>
User Provisioning <a href="https://apps-apis.google.com/a/feeds/user/">https://apps-apis.google.com/a/feeds/user/</a>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question