Before accessing the Image Artist Public API, you must obtain an authentication token. This token is generated by the
/authentication/token endpoint and must be included in subsequent API requests.
Requesting a Token
The following example uses curl to request an authentication token:
curl --insecure --location --request POST \
"https://<imageArtistDomain>/api/1.1/authentication/token" \
--header "Content-Type: application/json" \
--data-raw '{
"userName": "<user>",
"password": "<password>",
"urls": ["/api/1.1/*"]
}'Where:
<imageArtistDomain>is the domain name of the Image Artist host<user>is the Image Artist user account for which the authentication token is requested<password>is the password of the aforementioned user
Request Body
The request body contains the user credentials and the API paths for which access is being requested:
{
"userName": "<user>",
"password": "<password>",
"urls": ["/api/1.1/*"]
}In this example, the wildcard path
/api/1.1/* requests access to all endpoints under the API v1.1 namespace.
Example Response
If the request is successful, the server returns a JSON response containing the authentication token:
{
"token": "b453e28e-de55-40a2-8dc5-827732e801bb",
"urls": [
"/api/1.1/*"
]
}
Using the Token
The returned token can then be supplied in subsequent API requests according to the authentication requirements of the endpoint being called.
Note: Authentication tokens are associated with the permissions of the user account used to generate them. The token cannot be used to access resources beyond those already available to that user.
Comments
0 comments
Article is closed for comments.