create_agent Navigate to XML API

This REST API is used to create agent.

End Point https://www.vcareapi.com:8080/agent
Field (Short Description) Value/Tag Name Format Field Example Type Notes Validation rules
action String create_agent Required This needs to be passed as create_agent create_agent
first_name String John Required This is the first name of the agent that you are creating. Accepts these special characters: space, apostrophe (‘), accent Grave (`), hyphen (-). Minimum of 1 alphabetic character.
last_name String Doe Required This is the last name of the agent that you are creating. Accepts these special characters: space, apostrophe (‘), accent grave (`), hyphen (-). Minimum of 2 alphabetic characters.
agent_type String EMPLOYEE Required Here you should pass type of the agent . Expected values : MASTER, DISTRIBUTOR, RETAILER, EMPLOYEE
login_id String JohnDoe1 Required Here you should pass the login id of the agent by which agent will login. No special characters are allowed. Only spaces are allowed with characters and numeric.
login_password String ********* Required Here you should pass the password by which agent will login. Length of the password should not be less than 8 digits with minimum 2 characters having atleast 1 capital letter including the numeric value.
address_one String ABC main street Required Here you should pass the House number and street of the agent's address that you are creating. Accepts these special characters: space, forward slash (/), hash (#), hyphen (-).
address_two String apt 7 Optional Here you should pass the apartment number of the agent that you are creating. Accepts
city String CAMDEN Required This is the address city of the agent that you are creating. Accepts these special characters: space, hyphen (-).
state String NJ Required This is the address state of the agent that you are creating. State should be standard abbreviated form. Maximum two characters are allowed.
zip_code String 08104 Required This is the address ZIP code of the agent that you are creating. Should not allow letters and special characters, only numbers. Should be exactly 5 digits.
master String JohnDoe Optional Here you should pass the login id of the master under which you want to create an agent. If you are creating a distributor than this parameter is necessary. Login id of the master created in TG5.
distributor String Johndoe Optional Here you should pass the login id of the distributor under which you want to create the agent. If you are creating a retailer than this parameter is necessary. Login id of the distributor created in TG5.
retailer String John_Deo Optional Here you should pass the login id of the retailer under which you want to create the agent. If you are creating an employee than this parameter is necessary. Login id of the retailer created in TG5.
employee String Optional
email String noreply@gmail.com Required Here you should pass the email address of the agent that you are creating. Valid email address.
phone_number String 1234567895 Required Here you should pass the phone number of the agent that you are creating. Valid 10 digit phone number.
status String Active Optional By default the status is active but if you want the status to set to inactive than you can pass Inactive here. Expected values : Active , Inactive
user_group_type String safegroup Required Here, you can specify the group in which you'd like the agent to create.





Group name created in TG5.
residual_commission String Optional
residual_commission_amount String Optional
topup_access String Optional
topup_commission_amt String Optional
bill_pay_access String Optional
bill_pay_commission_amount String Optional
data_plan_access String Optional
data_plan_commission_amount String Optional
recertification_commission_access String Optional
recertification_commission_amount String Optional
intake_commission String Optional
source String API Required Source of the order/application Expected Value : API , WEBSITE
agent_id String John Doe Required This is the Telgoo5 user id . For the Agent/Employee who is sending the API request. This is the user login id which will be created in Telgoo5 for the API user.
agent_password String ******** Optional This is the password for the Agent Id mentioned above. This is configuration level field. If you have set the permissions for the Agent Id for the requirement of the password in API transactions then you will need to pass the Agent Password in all the REST API transaction, else if you have set the permissions to password not required then you don’t need to pass the Agent Password in the REST API.
Sample Request REST
{
    "first_name": "Test",
    "last_name": "again",
    "agent_type": "EMPLOYEE",
    "login_id": "sbhardwaj51555",
    "login_password": "Test@123",
    "address_one": "743 WHEATLAND CT",
    "address_two": "",
    "city": "CAMDEN",
    "state": "NJ",
    "zip_code": "08104",
    "master": "",
    "distributor": "",
    "retailer": "retailer",
    "employee": "",
    "email": "noreply@gmail.com",
    "phone_number": "1234567895",
    "status": "Active",
    "user_group_type": "safegroup",
    "residual_commission": "",
    "residual_commission_amount": "",
    "topup_access": "",
    "topup_commission_amt": "",
    "bill_pay_access": "",
    "bill_pay_commission_amount": "",
    "data_plan_access": "",
    "data_plan_commission_amount": "",
    "recertification_commission_access": "",
    "recertification_commission_amount": "",
    "intake_commission": "",
    "agent_password": "",
    "action": "create_agent",
    "agent_id": "ewebsiteapi",
    "source": "WEBSITE",
    "vendor_id": "Demo-Goknows"
}
List of status code, description and resolution.
Status Code Description How to Resolve?
RESTAPI000 SUCCESS SUCCESS
RESTAPI001 FAIL Multiple errors like Invalid Token, Token already used, Token expire & Invalid Access!!
RESTAPI101 FAIL Module required.
RESTAPI102 FAIL Action required.
RESTAPI103 FAIL Source Not Allowed.
RESTAPI104 FAIL Invalid Agent ID or Password.
RESTAPI105 FAIL Module does not exist.
RESTAPI106 FAIL Action does not exist.
RESTAPI107 FAIL Invalid company.
RESTAPI108 FAIL Invalid method.
RESTAPI109 FAIL Unauthorized Access.
RESTAPI010 FAIL Multiple errors come in an array.
Sample Response
{
    "data": "14944",
    "msg": "Success",
    "msg_code": "RESTAPI000",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGVtby1Hb2t3c1VzZXIiLCJwYXNzd29yZCI6IkRlbW8tR29rd3N0SzEyM2h5dXRydzIxIiwicGluIjoiRGVtby02MzIxNjc0MTY0NzQ1OCIsInZlbmRvcl9pZCI6IkRlbW8tR29rbm93cyIsImxvZ19pZCI6NzIyOTc1LCJ1cmwiOiJodHRwczovL2RlbW8tZ29rbm93cy50ZWxnb281LmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNzAyMDcwNTIzfQ.Ej8JbS7PpX8toSJkiPUEhQadvY8xSym4WnOB3UEHxyM"
}
SUCCESS
Sample Fail Response: 1
{
    
    "msg": "Invalid Token",
    "msg_code": "RESTAPI001",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ"
}
Error Description: Invalid Token
How to Resolve?: Provide valid token in header
Sample Fail Response: 2
{
    
    "msg": "Invalid Access!!",
    "msg_code": "RESTAPI001",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ"
}
Error Description: Invalid Access!!
How to Resolve?: Request method will be POST
Sample Fail Response: 3
{
    "errors":["Source Not Allowed"]
    "msg": "Source Not Allowed",
    "msg_code": "RESTAPI103",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ"
}
Error Description: Source Not Allowed
How to Resolve?: Provide valid Source
Sample Fail Response: 4
{
    "errors":["Agent Id should not be blank"]
    "msg": "Agent Id should not be blank",
    "msg_code": "RESTAPI104",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ"
}
Error Description: Agent Id should not be blank
How to Resolve?: Provide valid Agent Id
Sample Fail Response: 5
{
    "errors":["Invalid Agent Id"]
    "msg": "Invalid Agent Id",
    "msg_code": "RESTAPI104",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ"
}
Error Description: Invalid Agent Id
How to Resolve?: Provide valid Agent Id
Sample Fail Response: 6
{
    
    "msg": "Token already used",
    "msg_code": "RESTAPI001",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ"
}
Error Description: Token already used
How to Resolve?: You can use token once per request
Sample Fail Response: 7
{
    
    "msg": "Token expire",
    "msg_code": "RESTAPI001",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ"
}
Error Description: Token expire
How to Resolve?: Create token again
Sample Fail Response: 8
{
    "errors":["Please enter Enrollment Id"]
    "msg": "Error occurred",
    "msg_code": "RESTAPI110",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ"
}
Error Description: Error occurred
How to Resolve?: Provide Enrollment Id