You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Current »

ResourceApiUsers
URL/api/v2/api_users
Supported Standard Operations
  • Add
  • Delete
  • Edit
  • View (one)
  • View (all)
Additional Operations
  • Generate

Attributes

  • See api_users for definitions of other attributes and elements
AttributeValueRequired?
co_idCO IDYes
usernameAPI UsernameYes
api_keyAPI KeyNot permitted on write operations, use generate instead
statusAPI User StatusYes
privilegedWhether this API User is privileged
valid_from

Valid from (timestamp)


valid_throughValid through (timestamp)
remote_ipRegular expression describing permitted remote IP addresses for this API User

Sample Record

{
  "co_id": 2,
  "username": "TestCO.apiuser",
  "api_key": "$2y$10$p/8mPy9hm1OU3tlvV4gHpG.e7ONH1YqBbcXGppxHyDz9awpbYQAfP",
  "status": "A",
  "privileged": true,
  "valid_from": null,
  "valid_through": "2019-06-30T03:59:59+00:00",
  "remote_ip": "/10\.0\.1\.2/"
}

Supported Filters

View (all)

Additional filters:

  • co_id

Example: Obtain API Users in a given CO

GET /registry/api/v2/api_users?co_id=2

Additional Operations

Generate

Generate an API key for an existing object. This call must be made after a successful add request, using the resulting API User ID.

Request Format

RequestPOST /api/v2/api_users/generate/id

Request Body

Empty JSON document (see example, this is not the same as an empty document)

Paginated?No

Response Format

HTTP Status

Response Body

Description

200 OK


Update successful

400 Bad Request

Error Response

Attribute validation failed or id not found

401 Unauthorized


Authentication required

500 Internal Server Error

Error Response

Server error

Example: Generate API Key

POST /registry/api/v2/api_key/16
{
}
 
200 OK
{
  "results": {
    "api_key": "hjem-9725-udxp-2388"
  }
}

  • No labels