markciecior / ConnectPyse

ConnectWise (Manage) REST API client written in Python 3.x
MIT License
21 stars 8 forks source link

Time Entry Question #20

Closed nyteghost closed 2 years ago

nyteghost commented 2 years ago

When I try to make a time entry, I get a security error.

Server message:{ "code": "Security", "message": "You do not have security permission to perform this action." }

I am able to make TimeEntries for myself in the Manage App itself, but not through the API.

def createTimeEntryCP(TicketNumber,User): time_Entry = time_entries_api.TimeEntriesAPI(url=cwURL, auth=config['cwHeaders'],) note = time_entry.TimeEntry({ 'chargeToId': TicketNumber, 'chargeToType': 'ServiceTicket', 'member': {"identifier": User}, 'workType': {"name": "Remote"}, 'timeStart': '2022-01-17T12:00:00Z', 'timeEnd':'2022-01-17T21:00:00Z' }) time_Entry.create_time_entry(note)

Am I doing something incorrect here, or is it a restriction on my account?
markciecior commented 2 years ago

1) I'm 99% sure this is due to an error with the permissions on your API account. 2) When I create time entries I submit the member attribute with {'id': 123} rather than {'identifier': "blah"}. I really doubt that would make a difference, but it might be worth a shot.

nyteghost commented 2 years ago

I gave that a shot and same thing. I am thinking you are right and it is something to do with my API permissions.