API: createAdhocAPIKey
- 1 Minute to read
- Print
- DarkLight
API: createAdhocAPIKey
- 1 Minute to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
- Starting June 1, 2022, SmarterU will require all API calls to POST to HTTPS. Any POST to HTTP will result in the SU:01 error (i.e., No POST data detected.).
- If you are viewing the help in a language other than English, please change your language to English before copying and pasting any code. All API attributes and functions are in English.
- Tags are required unless specified.
This feature is not enabled by default. If you're interested in using this feature, contact our Success Desk to have it enabled.
Description
The createAdhocAPIKey API method returns a temporary API key for a user.
The API key returned by the createAdhocAPIKey method will expire after 3 minutes.
Who Has Access
Administrators and owners have access to the createAdhocAPIKey method.
API Call XML Package
<SmarterU>
<AccountAPI><![CDATA[]]></AccountAPI>
<UserAPI><![CDATA[]]></UserAPI>
<Method>createAdhocAPIKey</Method>
<Parameters>
<User>
<Identifier>
<ID><![CDATA[]]></ID>
- OR -
<Email><![CDATA[]]></Email>
- OR -
<EmployeeID><![CDATA[]]></EmployeeID>
</Identifier>
</User>
</Parameters>
</SmarterU>
User Tag Group
The User tag group is a container for the user you'd like to create an API key for.
<User>
<Identifier>
<ID><![CDATA[]]></ID>
- OR -
<Email><![CDATA[]]></Email>
- OR -
<EmployeeID><![CDATA[]]></EmployeeID>
</Identifier>
</User>
The User tag contains the following.
Identifier
A container for the user that you'd like to create an API key for. The tag contains one of the following.
Tag | Description |
---|---|
ID | The user's system-generated identifier. This tag is mutually exclusive with the Email and EmployeeID tags. This is the ID returned by the listUsers method. |
The user's email address. This tag is mutually exclusive with the ID and EmployeeID tags | |
EmployeeID | The user's employee ID. This tag is mutually exclusive with the ID and Email tags. |
API Response XML Package
The API response XML package will always include a Result, Info, and Errors tag.
<SmarterU>
<Result></Result>
<Info>
<User>
<APIKey><![CDATA[]]></APIKey>
</User>
</Info>
<Errors>
<Error>
<ErrorID></ErrorID>
<ErrorMessage></ErrorMessage>
</Error>
</Errors>
</SmarterU>
The User tag is a container for the API key returned by the createAdhocAPIKey method and contains the following.
APIKey
The API key that was created for the user.
Example API Response XML Package
Below is an example of an API response XML package.
<SmarterU>
<Result></Result>
<Info>
<User>
<APIKey><![CDATA[*ldf^dypgnvi*nq33gml$*6xsup2*wpa8x$if2q4]]></APIKey>
</User>
</Info>
<Errors>
</Errors>
</SmarterU>
Error Codes
Error Code | Message |
---|---|
CAAK:01 | The id provided is not valid. |
CAAK:02 | The email address provided is not valid. |
CAAK:03 | The employee ID provided is not valid. |
CAAK:04 | The required permissions are not met to call the createAdhocAPIKey method. |
CAAK:05 | The user requested does not exist. |
CAAK:06 | This method cannot be accessed from your location. |
CAAK:07 | The requested user cannot be retrieved via the API. |
Was this article helpful?