Getting Started
Registering on the public grid connect portal
- In order to get started, you must first register as a company on our portal.
- Accounts:This section allows you to see all the customers who have accepted your connect request. You will be able to see all the details pertaining to those accounts.
- API Key: You will require the API key in making all the API calls. The API key generated will be a Bearer token used as an authorization header in all the HTTP requests.
Make your first API call with Connect Request
Prerequisites
Before you begin, make sure you have the necessary credentials and parameters ready. Specifically, ensure you have an active account on the Connect platform. If you don't have an account yet, you can easily create one by completing the sign-up process.
Step 1 : Getting the Access Token.
To acquire the Bearer Token, log in to the Connect platform and generate a new token using the API keys feature available on the platform.
Step 2 : Sending request to the create-connect-request API.
Once you have the Bearer token, use it as an authorization header. This guide provides cURL examples, but you can also use Postman for the same response. Ensure you configure Postman with the following request configuration. Including the redirect URL is optional since the API will generate a link specific to that company.
Create Connect Request
To initiate a connect request, perform a POST request to the designated endpoint "https://dev.onepublicgrid.dev/connect/create-connect-request ":
curl https://dev.onepublicgrid.dev/connect/create-connect-request \
-X POST \
-H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"redirectUrl": "YOUR_REDIRECT_URL"}(optional)'
Replace "YOUR_REDIRECT_URL" with the specified connect request link provided by the company(optional)and "YOUR_ACCESS_TOKEN" with the token generated in step 1.
If you do not want to include the connect request link as the redirect url, simply use the following cURL example.
curl https://dev.onepublicgrid.dev/connect/create-connect-request \
-X POST \
-H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
-H "Content-Type: application/json"
Response
Upon making the above request, you'll receive the following response:
{"redirect":"YOUR_REDIRECT_URL"}
This response contains the connect request link that the company can send to a customer to access their utility data.
All Done!
Using the above steps, you have successfully made your first call to the create-connect-request API and have generated a create connect request link.
Updated 8 months ago