What is the correct way to call this method?
If you're trying to list users from AWS IAM Identity Center, you need to use the region-specific Identity Store API URL instead. This is different from how you list users in IAM.
Unlike IAM, it uses POST request with a JSON body to the following URL (assuming you have set the authorization headers for AWS correctly):
https://identitystore.${identity_center_region}.amazonaws.com/
(The path is /
.)
Request headers:
Content-Type: application/x-amz-json-1.1
X-Amz-Target: AWSIdentityStore.ListUsers
Request body:
{
"IdentityStoreId": "${identity_store_id}"
}
Replace ${identity_center_region}
with the region where you created your Identity Center instance (e.g. us-east-1
) and replace ${identity_store_id}
with its ID (e.g. d-1234567890
).
Nick Frichette explains how AWS API requests are structured based on different protocols on his blog.As he points out in the blog, all of this can be found in the AWS SDKs, but we'll use Botocore here.
To construct an API request for Identity Store using Botocore, you can refer to the following sources:
The Identity Store API's endpoint URL is defined in Botocore's endpoint rule set:
"endpoint": {
"url": "https://identitystore.{Region}.amazonaws.com",
"properties": {},
"headers": {}
},
You can check the serialization logic for JSON for the expected request headers:
serialized['headers'] = {
'X-Amz-Target': target,
'Content-Type': f'application/x-amz-json-{json_version}',
}
The service definition file provides metadata about the request format and operation:
"metadata": {
"apiVersion": "2020-06-15",
"endpointPrefix": "identitystore",
"jsonVersion": "1.1",
"protocol": "json",
"serviceAbbreviation": "IdentityStore",
"serviceFullName": "AWS SSO Identity Store",
"serviceId": "identitystore",
"signatureVersion": "v4",
"signingName": "identitystore",
"targetPrefix": "AWSIdentityStore",
"uid": "identitystore-2020-06-15"
},
The ListUsers
operation is defined with its HTTP method and path:
"ListUsers": {
"name": "ListUsers",
"http": {
"method": "POST",
"requestUri": "/"
}
}
So combine all this information and you have everything needed to construct the final request in Postman.