Initiating Client instances #111
-
Here I'm going to use Contact Form 7 hook to create an Entity. Is it correct to initiate the $client instance on every call? Any other solution? |
Beta Was this translation helpful? Give feedback.
Answered by
georged
May 1, 2024
Replies: 1 comment 1 reply
-
$webapi = ConnectionService::instance()->getClient();
$webapi->Create(...); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
clhettiarachchi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
createOnlineClient
takes logger and cache pool as optional parameters. If cache pool is set, we will cache the access token and bypass the call to the authentication endpoint, if possible. It does look like you're using the client inside the Dataverse plugin. In that instance you should be using the client provided by the plugin that takes care of caching: