Before each request to the DocuSign REST API, I make a call to https://demo.docusign.net/restapi/v2/login_information
. But the only information I need from that
Since it is a third-party API outside your control, I would recommend that you follow the requirements of the documentation, and make the call each time. There's no telling when they might change the internals of the API.
Short answer: cache with caution. It will most likely never change, but if it does, just grab it again. I would make the call at the beginning of a set of requests, and then forget about it.
The baseUrl parameter would look like: "https://demo.docusign.net/restapi/v2/accounts/123456"
To break it down:
You would need to know this url for every api call. I wouldn't store it 'forever' just to be safe, but you could cache it for a short time to reduce the number of API calls. Your accountId should never change on the environment, but we do provide new environments occasionally, and every different account will have a different baseUrl.
For reference, see here: https://docs.docusign.com/esign/guide/usage/quickstart.html
If you really want to store it for a long time, I would set a 30 day time-out or something along those lines.