Employee
Works with a single employee.
Base URL
https://{{accountid}}.restlets.api.netsuite.com/app/site/hosting/restlet.nl?script=customscript_prac_api_employee&deploy=customdeploy_prac_api_employee_v1
HTTP: GET
Gets the employee record for a given internal id.
Required Parameters
| Name | Value | Notes |
|---|---|---|
| script | customscript_prac_api_employee | |
| deploy | customdeploy_prac_api_employee_v1 | |
| custparam_id | {{integer}} | The internal id of the employee you are retrieving. |
HTTP: POST
Creates a new employee based on data in JSON payload.
Payload
The payload passed in the POST request should be JSON format. It must contain at least one key-value pair of fields to update. You may pass multiple fields to update. Keys are internal IDs of the fields unless otherwise noted here. Some fields are mandatory and not all fields are allowed. Any invalid fields will be specified in the response.
Address data uses an array at key entityaddress.
{
"firstname": "Ben",
"lastname": "James",
"subsidiary": 2,
"location": 1,
"department": 1,
"custentity_gvcpa_generalsupervisor": 1738,
"email": "test12_emp@test.com",
"custentity_gvcpa_employeebaserate": 100,
"entityaddress": [
{
"defaultshipping": false,
"label": "Test Address 1",
"country": "US",
"attention": "Mr. Test",
"addressee": "Mr. Fake",
"addrphone": "6082387643",
"addr1": "123 Fake St.",
"addr2": "Apt. 0",
"zip": "53717",
"city": "Madison",
"state": "WI",
"addrtext": "",
"override": false
},
{
"defaultshipping": true,
"label": "Test Address 2",
"country": "US",
"attention": "Mr. Test",
"addressee": "Mr. Fake",
"addrphone": "6082387643",
"addr1": "444 Fake St.",
"addr2": "Apt. 0",
"zip": "53717",
"city": "Madison",
"state": "WI",
"addrtext": "",
"override": false
}
]
}
HTTP: PUT
Updates an existing record based on data in JSON payload. Only the data included in the request will be updated. The internal ID of the record must be included in the request, specified as id. Some fields are mandatory (meaning they cannot be cleared) and not all fields are allowed. Any invalid fields will be specified in the response.
Note: to update addresses, use Contact Associations endpoint.
Payload
{
"id": 2966,
"email": "test1@test.com"
}