DocuSign API Integration in Laravel - php

Is it necessary to have an account of docusign for the client who is going to sign the document?

For the most part - no
Signers don't need to have an account with DocuSign.
You do have to have an account for the "sender" which is the account authenticate via the API and used to obtain an access token which is then used to make the API call that generates the envelope.

Related

Google Task API

I am going to fetch Google Tasks via API on the server without using the browser but when I am calling the API, it gives me redirect link to authenticate the application as in the documentation here.
I don't want the redirection to browser, verify the application, and get the auth code. I just need to get the auth code when I call the API.
Is there any way to do it?
Answer
There is no way to achieve that using a normal account. You will have to use a Service Account.
Service Account
A Service Account is a special type of account which is used to execute API calls as a non-human user. So if you don't want any human user interaction during the authentication process, this would be the best way to go. Accordingly with the OAuth2 specification, this account will use a JWT (Json Web Token) to authenticate its API call. The Google API provides you with the scaffolding to use the Service Account credentials to build your services as you were doing with a normal account.
Further Reading
Here some recommended further reading and examples on Service Accounts
Understanding Service Accounts
PHP Service Account Sample

Implicit authentication for DocuSign Embedded Signing

I have tried the code grant examples(PHP) given in the API and they are working perfectly fine but for those examples i was trying implicit authentication but its not working. I'm not familiar with twig function used how to play with it.
I'm also new to Docusign, Can anyone help me with the php code that can be used for implicit authentication for generating access token and also handle if token expires.
OR
IS there a way by which users can sign on embedded document on my website through docusign implicit authentication without logging in to Docusign
I have tried code examples given in documentation of Docusign
I need users to sign on document who are already registered on my site after they log in.(Note: They dont have to login to Docusign)
Any help much appreciated,
Thanks
Re: how can a signer sign a document on my website? The signer has an account on my website and logs into my website.
After the signer logs into your website, you know who they are (name and, optionally, email).
In this case, your signers do not need a login with DocuSign.
Instead, your application should use the JWT Grant to access DocuSign on behalf of the person who sent (or will send) the envelope.
This user is sometimes called a "system user" or "application user" since it is a DocuSign user account that is used by your application itself. (It's the same as any other DocuSign user account.)
After creating the envelope your application obtains the URL for the signing ceremony for the specific signer using EnvelopeViews::createRecipient
Your application then redirects to the signing ceremony and the signer can sign.
Signers do NOT need a login to the DocuSign system
Re: Using the OAuth Implicit Grant flow
The Implicit Grant flow is used when a person wants to authenticate
with DocuSign itself and the application does not have a backend server
component. For example, the application runs entirely in the browser using the React framework.
In your use case, Implicit Grant should not be used since your signers
do not need a login on DocuSign. Instead, your application should use
the JWT Grant to impersonate a "system user" that will be used with DocuSign.

Can not access the Adsense Management API

Can not access the AdSense API no matter what I try. I have tried both service account and OAuth authentications.
What I am trying to accomplish:
Creating a bot that will grab the Adsense revenue earned and store it in an in-house database for tracking revenue over time. I do not want to have authentication issues, I want a server-to-server configuration.
What I do know is you can have access tokens and refresh tokens under OAuth. I've yet to be able to make them work under any available APIs with Adsense. Note: I have built an API to work with AdWords no problem.
Errors: (Between the types of authentication, I can not pass these)
"Account Not Found"
"Client is unauthorized to retrieve access tokens using this method."
What I have done so far:
The Adsense Management API is enabled.
Credentials Created: Service Account
Credentials Created: oAuth 2.0 Client ID
The GSuite account has access to APIs (includes "enabled api access" and "managed API client access")
Libraries (trying) to use:
https://developers.google.com/api-client-library/php/
https://github.com/google/google-api-php-client
https://github.com/google/google-api-php-client-services
(outdated) https://github.com/googleads/googleads-adsense-examples
Example code: (using the service account)
$client = new \Google_Client();
$client->setAuthConfig(WRITEPATH . 'auth/adsense-client.json');
$client->setIncludeGrantedScopes(true);
$client->addScope('https://www.googleapis.com/auth/adsense');
$client->setSubject('email#example.com');
// trying to fire the services
$service = new \Google_Service_AdSense($client);
$report = $service->accounts_reports->generate('clientId', $startDate, $endDate, $optParams);
This script fires the "Client is unauthorized to retrieve access tokens using this method." error message. However, the email address being used is able to access the adsense account, the APIs are enabled and configured on the admin domain level.
Is there an easier way? is there anyone who can lead me in the right direction?
Service account
I am not all that sure that Service accounts work with adsence. You can try by going to the adsence website and under manageUsers add the service account email address. The issue here is its going to sit there at pending i think because the service account needs to confirm that it has been added. There is no way to do that.
Admin domain level
If you are trying to add domain wide delegation to this i wouldn't bother with that either as far as i can see its not supported either.
Client is unauthorized to retrieve access tokens using this method.
As for that error i may be able to help. It means that you have taken the credentials file you downloaded for a service account and are trying to use it with the code for Oauth2. or visa versa. Download the credentials file again and try again.
I have some sample code that may help here

Authenticate specific gmail account Google API in PHP

I receive confirmation from users in my gmail account. I want to read them with a server side php script to display confirmation on my website. I got OAuth 2.0 client IDs and a service key from Google APis. How do I use these keys with the specific gmail account to get the emails? I cannot find any simple documentation.
You can not use a service account to access a normal users Gmail account. This is because there is no way to preauthorize it.
What you need to do is have the users authenticate your application using Oauth2 and get a refresh token for each user. Then you will be able to use the refresh token in your server sided script to request a new access token which you can use to read there gmails. The Google PHP client library team has created some examples for using their library which might help you. Google-api-php-client
Side note: If the users you are speaking of are part of a Google domains account then you can do it by giving service account permissions to access the users emails.

Google MC Funnels - Service account credentials?

There are two different types keys for " Service account credentials " JSON and P12
Please, which one is indicated to work with "Google MC Funnels API"?
Either can be used with MFC API. Service account credentials and Oauth2 credentials have nothing to do with the which API you can access. Except with regard to some APIs which don't support service accounts (YouTube API , and blogger to name two). Service account and Oauth2 are all about gaining access to the data you need.
Service account p12 file
Service accounts are used to access data you the developer have access to. If you want to grant someone else access to see your Google Analyitcs data you would use a service account. Setup will require that you take the service account email address and add it as a user at the account level in the google analytics website admin section. it must be the account level.
Oauth authentication Json file
Oauth2 will request a user give your application permission to access their data.

Categories