Contractors: post

Create a new Contractor.

Request - POST https://api-uat.vtopenview.com/contractors

You will need to supply a request body with this method.
You will need to sent on request your access token. For more information, see the authentication and authorization page.

Example request with authorization:

curl -- POST Base URI: https://api-uat.vtopenview.com/contractors
--header "Authorization: Bearer MTQ0NjJkZmQ5OTM2NDE1ghNNBiuyUYUN"

Request Body
Example request body:

Content-Type: application/json
{
"companyname": "string",
"website": "string",
"phone": "string",
"workphone": "string",
"mobilephone": "string",
"email": "string",
"publicliabilityrequired": boolean,
"publicliabilityexpirydate": "date",
"reference": "string",
"status": "string",
"negotiator": {
"userid": long,
"name": "string",
"email": "string"
},
"archived": boolean,
"contactnotes": "string",
"services_provided": [
{
"service": "string",
}
],
"branches_serviced": [
{
"branchid": integer,
"branchname": "string"
}
],
"udf": [
{
"udfid": long,
"value": "string"
}
]
}

Status:

The list below describes the possible status for contractors. This field is required.

Active
Inactive
Archived

Example field on request:

"status": "Active"

Services provided:

The list below describes the possible services types for contractors. This field is optional.
If your company has set up other services types on OpenView, please verify the string you are sending.

Gas
Electricity
Water

Example field on request:

"services_provided": [
{
"service": "Electricity",
},
{
"service": "Water",
}
]

Branches serviced:

You need to inform the list of the branches on your company that the contractor will provide services. This field is required.
You can get the Branch Ids from the return of the Branches List.

Example field on request:

"branches_serviced": [
{
"branchid": 1,
"branchname": "Your Branch Name"
},
{
"branchid": 2,
"branchname": "Your Branch Name 2"
}
]

Response

If successful, this method returns a response body with the following structure:

Example response:

HTTPS 200 OK
Content-Type: application/json
{
"contractorid": long,
"companyname": "string",
"website": "string",
"phone": "string",
"workphone": "string",
"mobilephone": "string",
"email": "string",
"publicliabilityrequired": boolean,
"publicliabilityexpirydate": "date",
"reference": "string",
"status": "string",
"negotiator": {
"userid": long,
"name": "string",
"email": "string"
},
"archived": boolean,
"contactnotes": "string",
"services_provided": [
{
"service": "string",
}
],
"branches_serviced": [
{
"branchid": integer,
"branchname": "string"
}
],
"udf": [
{
"udfid": long,
"value": "string"
}
]
}