Retrieves the TeamWork owner of a given database.
GSErrCode ACAPI_Database (
APIDb_GetTWOwnerID,
const API_DatabaseUnId* databaseUnId,
short* userId
);
Parameters
- databaseUnId
- [in] The unique ID of the database
- userId
- [out] The TeamWork user ID of the owner of the specified database
Return Values
NoError- The function has completed with success.
APIERR_BADPARS- The
dbUnIDor theuserIdparameter isnullptr, ordbUnIDis not valid
For other common API errors see the API Errors document.
Remarks
This function is used to get the user ID of the owner of a database.
You can get the user ID of the current TeamWork client with APIEnv_ProjectID.
Example
short userId = 0; API_DatabaseInfo databaseInfo; BNZeroMemory (&databaseInfo, sizeof (API_DatabaseInfo)); ACAPI_Database (APIDb_GetCurrentDatabaseID, &databaseInfo, nullptr); if (ACAPI_Database (APIDb_GetTWOwnerID, &(databaseInfo.databaseUnId), &userId) == NoError) DBPrintf ("TeamWork owner ID of the current database: %d\n", userId);
Requirements
- Version: API 10 or later
- Header: APIdefs_Database.h
See Also
API_DatabaseUnId
APIEnv_ProjectID
APIEnv_ProjectSharingID
ACAPI_Database
API Functions