HomeGuidesRecipesAPI
HomeGuidesAPILog In

SmartIQ API/User

SmartIQ API

The SmartIQ API Action extends the standard Send to REST Service Action by automatically adding a SmartIQ authentication token for the current user running the action in Produce, or for a specified user to impersonate where configured. This allows authenticated requests to be made to the SmartIQ API.

Usage

Similar to the Send to REST Service Action, this action takes a URL describing the REST endpoint, and will send a supplied Action Document (JSON or XML) to the endpoint as the request body.

Inputs

Input NameDescription
ImpersonationThe Action also supports the "As-User" impersonation, which allows the REST request to be handled as if the given user was the one making the request. In this case, the user running the action must have the "Impersonate" permission (which can be assigned to a Role in Manage). The impersonated user must have access to the resource(s) being accessed by the REST call as after audit logging the API call proceeds as if the impersonated user was the one making the call.To use the "As-User" impersonation, the "As-User (Impersonate)" input should be set to either the username or user GUID (whichever is available/convenient) of the user to be impersonated.
HTTP MethodThe HTTP method to use for the request. Supported values are "GET", "POST", "PUT", "DELETE" and "PATCH". Defaults to "POST" if not specified.
Output PathA parameter that defines a path in the REST response that will be output as the Output Path Data parameter
Request BodyJSON request to be included in REST request. it can have a question reference (specially relevant to be used with formula JsonEncode() to sanitize user entered values).
If action also includes a Document, it will be ignored and Action Input.
When implemented, Action ignores Send as Multipart.
Request SchemaPrevents unintentional JSON elements being included in a REST request due to injection from user input or specific parameters in the request. if Request Body action input is implemented, "Request Schema" needs to be supplied, validating the Body against the JSON Schema provided in this Action Input prior to sending the request.


  • If a Request Schema is not supplied, an error is thrown describing the rationale for requiring it.




  • If the Body fails validation against the Schema, an error is thrown describing which element(s) were incorrectly included/excluded.




  • Notably, if the provided Schema specifies that additional elements can be included, this is overridden. The supplied Schema needs to be an exact specification of which elements are to be allowed.



URL (Mandatory) The endpoint of the service.

Outputs

For Output configuration, refer to HTTP Status and Response and Output Path Data.

SmartIQ User

The SmartIQ User action creates and maintains user accounts.

📘

While the entire user account can be configured, the only required fields are Preferred Username and Update Existing User.

InputDescription
Custom FieldsOne per line. Specify any custom fields against the user. These are in the form of "name=value".
Disabled (True|False)If this is true, the user’s account has been disabled in Manage.
Display Info Messages in Manage (True|False)If this is true, verbose messages describing what the action is doing will be written to the Management log. This may be useful during testing.
First Name/Last Name/Email/Address Details/Job Title/Organisation/Phone NumberMatch up to the fields for a User.
Groups to AddOne per line. The user will be assigned to the groups specified.
Groups to RemoveOne per line. The user will be removed from the groups specified, prior to being added to any groups.

Note: A non-administrator user cannot add/remove other users (or themselves) from admin groups.
PasswordYou may define a new password for the user.
Preferred Username (Mandatory) Defines the username.
Reset Password (True/False)If True, a new password will be generated for the user. This flag will be ignored if the Password input is defined.
Reset Password on Next LoginDefines whether or not the user should reset their password the next time they log in.
ThemeDefines the skin file name.
Update Existing User (True|False) (Mandatory) If a username is found matching the username passed in, then this flag defines whether or not that user will be updated with the new details. If the flag is True, the user is updated. If the flag is False and a user is found, the Action Fails.

Outputs

OutputDescription
Existing User UpdatedReturns True if the user was already in the system and False for a new user.
PasswordIf a new password was assigned to the user, it will be returned here.
User Guid/ User ID/UsernameReturned if matched.

Dynamically Assigning Groups to Users with User Action

To dynamically create a user and assign multiple groups via the SmartIQ user action, add a replace formula that breaks the string and separates the selected group on each line via an ASCII code.

This is because the group names are coming from multiple row data source so it will be one string with a pipe delimiter that separates each value. For example, with GroupA|GroupB|GroupC, the action will be looking for the GroupA|GroupB|GroupC group name which does not exist as the groups need to be 1 per line, and so this will not work.

=Replace([q37.GroupName], “|”, chr(10))

Then reference the formula to the Groups attribute.

This will bring the string into the Groups attribute as 1 per line.