Defining the Current User
CompanyCam attributes a number of actions to the current User, or a designated User. Some examples of actions the current User can execute would be -
- Current User creating Document 1
- Current User assigning Project 1 to User B
- Current User uploading a photo to Project 2
Within our API, The current User is defined by the person who authenticated with CompanyCam using the OAuth2.0 flow. By default, objects like Project, Photo, and Document that were created through our API will assign the current User as the creator or editor.
In order to designate a different CompanyCam User as the creator or editor, you can send that User's CompanyCam email in the request header of your API call. The request field should include X_COMPANYCAM_USER
with the valid email of the User in CompanyCam.
curl --location "https://api.companycam.com/v2/projects" \
--header "X_COMPANYCAM_USER: [email protected]" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer {TOKEN}" \
--header "Cookie: \_production_companycam_session={SESSION_TOKEN}' \
--data '{
"name": "Project for Roof Job 4132",
"address": {
"street_address_1": "4132 Pleasant St",
"city": "Lincoln",
"state": "NE",
"postal_code": "68508",
"country": "US"
}
}'
Endpoints that use X_COMPANYCAM_USER
in Request Header
X_COMPANYCAM_USER
in Request Header- Add Photo Comment
- Add Project Comment
- Add Project Photo
- Assign a user to a project
- Create a new project invitation for collaboration
- Create checklist on project from a checklist template
- Create Group
- Create Project
- Create User
- Delete Photo
- Delete User
- Remove assigned user from project
- Update User
- Upload a Project Document
Updated 7 months ago