Add an agent record to the MoversSuite database.
Request Format
https://{server}/api/agents
HTTPS Verb/Method:
POST
Request Parameter
The following table describes the parameter available for the Add Agent Request.
Parameter |
Description |
{server} |
Provide the name of the server running the MoversSuite API Service. |
Request Return
Upon a successful call, the request returns the unique record identifier (Agent.PriKey).
Upon an error, the request returns zero (0) and writes an exception to the MssApiService Logging.
Input Properties
This section lists the data needed to add an agent record to MoversSuite using this method. The data must be set in the JSON format. The following example illustrates such a request.
REQUEST EXAMPLE:
https:////server/api/agents
INPUT EXAMPLE:
{
"Active": true,
"Address": {
"Address1": "123 Coffee Road",
"Address2": null,
"Address3": null,
"City": "Portland",
"Country": "United States of America",
"PostalCode": "97008-4986",
"State": "OR"
},
"Contacts": [{
"Contact": "Thomas Barry",
"Email": "tbarry@spamfree.com,
"PrimaryContact": true,
"Title": "Roaster",
"PhoneNumbers": {
"AreaCode": "808",
"CountryCode": "1",
"Extension": null,
"LocalNumber": "315-5224",
"PhoneType": "Main"
}
},
{
"Contact": "Alex Arabica",
"Email": "aarabica@spamfree.com,
"PrimaryContact": false,
"Title": "Grinder",
"PhoneNumbers": {
"AreaCode": "808",
"CountryCode": "1",
"Extension": null,
"LocalNumber": "315-5223",
"PhoneType": "Main"
}
}],
"AgentID": "U1234",
"County": "Multnomah",
"HaulOwnAuthority": true
"HaulVanLineAuthority": false,
"Memo": "Fax 503-893-0500 ",
"Name": "EWS Moving Systems",
"PhoneNumbers": [{
"AreaCode": "800",
"CountryCode": "1",
"Extension": null,
"LocalNumber": "828-7144",
"PhoneType": "Phone"
},
"AreaCode": "503",
"CountryCode": "1",
"LocalNumber": "828-4945",
"PhoneType": "Fax"
}],
"System": "UniGroup Queues",
"VanlineCode": "U",
"VendorID": "EWS Moving"
}
OUTPUT EXAMPLE:
3077
The following table describes the data returned by this method. All properties are considered “null” unless otherwise specified.
NOTE |
Properties denoted as “REQUIRED” must be set. |
Property |
Description |
Active |
Set the Inactive flag as set through Agent Setup. |
Address |
Set the address for the Agent Setup. Data set through this property include: Address1 Address2 Address3 City Country PostalCode State
|
Contacts |
Establish contact record for the agent record. This information is accessible through Add Agent Contact. |
AgentID |
REQUIRED - Specify the unique identifier for the agent record. This setting corresponds to the Agent ID within Agent Setup.
Note: The combination of AgentID and VanLineCode must not exist within MoversSuite. See Agent API Setup for more information.
|
County |
Provide the county of the agent record. This corresponds to the County set within Agent Setup. |
HaulOwnAuthority |
Set to “true” if the Haul Own Authority flag is set for the record within Agent Setup, set to “false” otherwise. |
HaulVanLineAuthority |
Set to “true” if the Haul Van Line Authority flag is set for the record within Agent Setup, set to “false” otherwise. |
Memo |
Provide a Memo value for the record through Agent Setup. |
Name |
REQUIRED - This is the full, descriptive name of the agent visible hrough Agent Setup. |
PhoneNumbers |
Up to two phone number records can be entered for the Agent Setup record: (1) Primary phone for the account as defined with a PhoneType entry of “Phone”; and (2) A fax number for the agent contact defined with a PhoneType entry of “Fax.” Data set for a PhoneNumbers entry for a PhoneType of “Phone” include the following (refer to Agent Setup and Phone Number Entry for field descriptions): AreaCode CountryCode Extension LocalNumber PhoneType (set to “Phone”)
Data appearing for a PhoneNumbers entry with a PhoneType of “Fax” includes (refer to Agent Setup and Phone Number Entry for field descriptions): AreaCode CountryCode LocalNumber PhoneType (set to “Fax”)
|
NOTE: You cannot add a Market assignment using this request. Please use the Add Agent Market Request. | |
System |
REQUIRED - The System links this record to a XML System Setup record. The value entered here must match the External System defined within XML System Setup. See Agent API Setup for more information. |
VanLineCode |
REQUIRED - Associate this record to a particular van line. The code entered here is defined in Van Line Setup for a Van Line that links to this agent record through Agent Setup. This value must also match the External Code for the System property within XML Interface Setup.
Note: The combination of AgentID and VanLineCode must not exist within MoversSuite.
See Agent API Setup for more information. |
VendorID |
This setting links the agent to a vendor record in Microsoft Dynamics GP. Enter the appropriate identifier for this agent’s record as defined in Dynamics GP.
Note: This property must match an entry within the VENDORID on the PM00200 database table.
|