Page History
In this section
Children Display |
---|
...
id | 1044102087 |
---|
...
id | 1044102090 |
---|
Content block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
When using cURL, user credentials (user name/password or a token) can be provided in a command-line argument. A new session is created during authentication. It is very important to note that a TWC session remains open after a REST API returns. This implies that a TWC session is not closed automatically. If the user’s credentials are still in use (without sending a valid cookie), the license count will be used up, and new sessions cannot be created. The user needs to wait until the session is timed out. The default timeout is 15 minutes. The correct way to use REST API is to log in only once, reuse the session for all subsequent calls, and log out once finished. The following example is a Bash script used for creating a comma-separated list of email addresses for all users in TWC, to facilitate notification sending.
The first execution of cURL logs in to the server. The server returns a session ID in a cookie. The cookie is saved into the cookie.txt file. The remaining cURL calls send the cookie back to the server to reuse the open session. The example below shows how to use PowerShell to create internal users from a CSV file.
|
...
id | 1044102086 |
---|
Related pages
...