Create Consumer API
Introduction
This page provides step-by-step instructions for creating a consumer in the mGramSeva system using two API calls. The first API call is for creating a property, and the second API call is for making a connection for the consumer.
Pre-requisites
Before proceeding with the given tasks, ensure the following prerequisites are met:
Authentication Token (authToken): Obtain a valid authentication token for the desired environment. This token is necessary to authenticate and authorize your requests.
API Endpoints: Ensure you have access to both APIs required for creating a property and a consumer. Make sure you have the correct API documentation or information about the endpoints, request payloads, and any required headers.
Postman: If you don't have Postman installed, download and install it. Import this collection in Postman. Make sure you change the URL as per your requirements.
Steps
Follow the steps given below to create consumers using either Property Create API or Consumer Create API.
1. Property Creation API
Here's a step-by-step guide:
Locate the Property Creation API:
Open the Postman collection you imported.
Find the request corresponding to the Property Creation API. It might be named something like "Create Property" or similar.
Set Request Parameters:
Review the request parameters for creating a property.
For metered connections, provide values for
initialMeterReading
,meterReading
,meterId
, andpreviousReading
. Set them to null if not applicable.Set
ConnectionType
to "Metered" for metered connections and "Non_Metered" for non-metered connections.Ensure that
oldConnectionNo
is unique every time you create a property.
Execute the Request:
Click on the "Send" button to execute the request.
Review the response to confirm that the property has been created successfully.
Copy Property ID:
In the response, you should find the
propertyId
field. Copy the value ofpropertyId
as this will be needed for subsequent steps.
Now, you have successfully created a property, and you have the propertyId
copied for future use. Ensure to follow any additional instructions provided in the Postman collection or the API documentation.
2. Consumer Creation API
Follow the steps below to create a consumer using the Consumer Creation API from the Postman collection:
Locate the Consumer Creation API:
Open the Postman collection.
Find the request corresponding to the Consumer Creation API. It may be named "Create Consumer - Metered" for metered connections or "Create Consumer - Non-Metered" for non-metered connections.
Set Request Parameters:
Review the request parameters for creating a consumer.
For metered connections, provide values for
initialMeterReading
,meterReading
,meterId
, andpreviousReading
. Set them to null if not applicable.Set
ConnectionType
to "Metered" for metered connections and "Non_Metered" for non-metered connections.Ensure that
oldConnectionNo
is unique every time you create a consumer.Use the
propertyId
obtained from creating the property as instructed in the previous step.
Execute the Request:
Click on the "Send" button to execute the request.
Review the response to ensure that the consumer has been created successfully.
By following these instructions and providing the necessary details, you should be able to successfully create a consumer with a property and connection in the mGramSeva system. Ensure that you follow any additional guidelines or instructions provided in the Postman collection or API documentation.
Last updated