- Download the attached ZIP file containing a PHP Script which will generate API Authenticated URLs.
- Login to Opus 2 as a System Admin.
- Browse to System Admin > Server Settings. You will need to copy the User Access Code for user in attached script.
- Open the attached Script (generateAPIAuth.php) in a Text Editor or PHP Editor.
- You will need to edit the following lines to your appropriate values:
Line | Description | Current Value | Your Value (Example) |
---|---|---|---|
178 | apiuser - Account with API Access enabled. | '{System Admin Email}' | '[email protected]' |
180 | annotateuser - System Admin Account, typically same as above. | '{System Admin Email}' | '[email protected]' |
182 | serverurl - the url address of your instance | 'https://{yourURL}/secure/api/' | 'https://example.opus2.com/secure/api/' |
183 | apikey - your user access token | '{User Access Code}' | 'abcdefgh12345678' |
Note: Single Quotes should be included in the script, as in the given examples. Your chosen user account will also need to be authenticated as an API user - please contact Opus 2 Platform Support to arrange this.
- Run the script using php generateAPIAuth.php, if you are unable to run this, please contact Opus 2 Platform Support with the above parameters and we can provide you the output. An example output is shown below:
https://example.opus2.com/secure/api/apiListAllWorkspaces.php?api-user=example%40test.com&api-auth=bHVBaeE%2FZBocLqopiUbk0Q0ivp0%3D&api-annotateuser=example%40test.com&api-requesttime=1658530447&include-users=1
- The response request will be in JSON format, with the following information attached:
- Workspace ID
- Workspace Name
- Workspace Users