All users can see all organizations, and admins can manipulate them.
A list of matching organizations may be queried by the system. The optional query parameters are as follows:
| Name | Value Description |
|---|---|
| text | text to search for in the name, long name and/or description |
| offset | offset into list of organizations for paging |
| limit | limit to show for paging. The maximum number of organizations to display is 1000. |
To query for organizations, add query parameters after the sensors URL as follows:
| URL | https://smartstreets.sensetecnic.com/wotkit/api/orgs?{query} |
| Privacy | Public |
| Format | json |
| Method | GET |
| Returns | On error, an appropriate HTTP status code; On success, OK 200 and a list of organizations matching the query from newest to oldest. |
To view a single organization, query by name:
| URL | https://smartstreets.sensetecnic.com/wotkit/api/orgs/{org-name} |
| Privacy | Public |
| Format | json |
| Method | GET |
| Returns | Appropriate HTTP status code; OK 200 - if successful |
Output:
{
"id": 4764,
"name": "electric-inc",
"longName": "Electric, Inc.",
"description": "Electric, Inc. was established in 1970.",
"imageUrl": "http://www.example.com/electric-inc-logo.png"
}
To register a new organization, you POST an organization resource to the url /org.
To create an organization:
| URL | https://smartstreets.sensetecnic.com/wotkit/api/orgs |
| Privacy | Admin |
| Format | json |
| Method | POST |
| Returns | HTTP status code; Created 201 if successful; Bad Request 400 if organization is invalid; Conflict 409 if an organization with the same name already exists |
To update an organization:
| URL | https://smartstreets.sensetecnic.com/wotkit/api/orgs/{org-name} |
| Privacy | Admin |
| Format | json |
| Method | PUT |
| Returns | HTTP status code; No Content 204 if successful |
Deleting an organization is done by deleting the organization resource.
To delete a user:
| URL | https://smartstreets.sensetecnic.com/wotkit/api/orgs/{org-name} |
| Privacy | Admin |
| Format | not applicable |
| Method | DELETE |
| Returns | HTTP status code; No Content 204 if successful |
To query for organization members:
| URL | https://smartstreets.sensetecnic.com/wotkit/api/orgs/{org-name}/members |
| Privacy | Admin |
| Format | not applicable |
| Method | GET |
| Returns | On error, an appropriate HTTP status code; On success, OK 200 and a list of organization members. |
To add new members to an organization, post a JSON array of usernames:
| URL | https://smartstreets.sensetecnic.com/wotkit/api/orgs/{org-name}/members |
| Privacy | Admin |
| Format | json |
| Method | POST |
| Returns | On error, an appropriate HTTP status code; On success, OK 204. |
Usernames that are already members, or usernames that do not exist, will be ignored.
For instance, to add the users “abe”, “beth”, “cecilia” and “dylan” to the organization “electric-inc”:
example
curl --user {id}:{password} --request POST
--header "Content-Type: application/json" --data-binary @users-list.txt
'https://smartstreets.sensetecnic.com/wotkit/api/orgs/electric-inc/members'
The file users-list.txt would contain the following.
["abe", "beth", "cecilia", "dylan"]
To remove members from an organization, DELETE a JSON array of usernames:
| URL | https://smartstreets.sensetecnic.com/wotkit/api/orgs/{org-name}/members |
| Privacy | Admin |
| Format | json |
| Method | DELETE |
| Returns | On error, an appropriate HTTP status code; On success, OK 204. |
Usernames that are not members, or usernames that do not exist, will be ignored.