I have followed the API documentation to insert an org unit but I am recieving a "Bad Request" error. Here is a snippet of my code.
function orgUnitCreate() {
var resource = {
name: first+' '+init,
parentOrgUnitPath: '/Students/'+unit,
blockInheritance: false
};
AdminDirectory.Orgunits.insert(resource, "myCustomerID redacted for privacy");//This is the line throwing the error
}
Thank you for your help
edit: I did indeed have an error in my customer ID, thank you
This error can result from
400 Bad Request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error
Summary
As mentioned in the comment section, this problem might be caused by a missing/incorrect customerID.
Reference