Track Action
API schema
const request = {
userId: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
action: "signIn",
attributes: {
redirectUrl: "https://yourapp.com/callback",
},
};
const response = await authsignal.track(request);
if (response.state === "CHALLENGE_REQUIRED") {
// Present challenge via Authsignal pre-built UI URL
const url = response.url;
} else if (response.state === "ALLOW") {
// Allow the user to sign in
} else if (response.state === "BLOCK") {
// Block the user from signing in
}
var request = new TrackRequest(
UserId: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
Action: "signIn",
Attributes: new TrackAttributes(
RedirectUrl: "https://yourapp.com/callback"
)
);
var response = await authsignal.Track(request);
if (response.State == UserActionState.CHALLENGE_REQUIRED) {
// Present challenge via Authsignal pre-built UI URL
var url = response.Url;
} else if (response.State == UserActionState.ALLOW) {
// Allow the user to sign in
} else if (response.State == UserActionState.BLOCK) {
// Block the user from signing in
}
TrackRequest request = new TrackRequest();
request.userId = "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833";
request.action = "signIn";
request.attributes = new TrackAttributes();
request.attributes.redirectUrl = "https://yourapp.com/callback";
TrackResponse response = authsignal.track(request).get();
if (response.state == UserActionState.CHALLENGE_REQUIRED) {
// Present challenge via Authsignal pre-built UI URL
String url = response.url;
} else if (response.state == UserActionState.ALLOW) {
// Allow the user to sign in
} else if (response.state == UserActionState.BLOCK) {
// Block the user from signing in
}
response = Authsignal.track(
user_id: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
action: "signIn",
attributes: {
redirect_url: "https://yourapp.com/callback",
}
)
case response[:state]
when "CHALLENGE_REQUIRED"
# Present challenge via Authsignal pre-built UI URL
url = response[:url]
when "ALLOW"
# Allow the user to sign in
when "BLOCK"
# Block the user from signing in
end
response = authsignal.track(
user_id="dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
action="signIn",
attributes={
"redirectUrl": "https://yourapp.com/callback"
}
)
if response["state"] == "CHALLENGE_REQUIRED":
# Present challenge via Authsignal pre-built UI URL
url = response["url"]
elif response["state"] == "ALLOW":
# Allow the user to sign in
pass
elif response["state"] == "BLOCK":
# Block the user from signing in
pass
$response = Authsignal::track([
'userId' => "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
'action' => "signIn",
'attributes' => [
'redirectUrl' => "https://yourapp.com/callback"
]
]);
switch ($response["state"]) {
case "CHALLENGE_REQUIRED":
// Present challenge via Authsignal pre-built UI URL
$url = $response["url"]
break;
case "ALLOW":
// Allow the user to sign in
break;
case "BLOCK":
// Block the user from signing in
break;
}
response, err := client.Track(
TrackRequest{
UserId: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
Action: "signIn",
Attributes: &TrackAttributes{
RedirectUrl: "https://yourapp.com/callback",
},
},
)
switch response.State {
case "CHALLENGE_REQUIRED":
// Present challenge via Authsignal pre-built UI URL
url := response.Url
// Use url for redirect
case "ALLOW":
// Allow the user to sign in
case "BLOCK":
// Block the user from signing in
default:
// Handle unexpected state
}
Get Action
API schema
const request = {
userId: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
action: "signIn",
idempotencyKey: "83d07321-9bba-4f08-a871-02e2af813b72",
};
const response = await authsignal.getAction(request);
var request = new GetActionRequest(
UserId: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
Action: "signIn",
IdempotencyKey: "83d07321-9bba-4f08-a871-02e2af813b72"
);
var response = await authsignal.GetAction(request);
GetActionRequest request = new GetActionRequest();
request.userId = "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833";
request.action = "signIn";
request.idempotencyKey = "83d07321-9bba-4f08-a871-02e2af813b72";
GetActionResponse response = authsignal.getAction(request).get();
response = Authsignal.get_action(
user_id: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
action: "signIn",
idempotency_key: "83d07321-9bba-4f08-a871-02e2af813b72")
response = authsignal.get_action(
user_id="dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
action="signIn",
idempotency_key="83d07321-9bba-4f08-a871-02e2af813b72"
)
$response = Authsignal::getAction([
'userId' => "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
'action' => "signIn",
'idempotencyKey' => "83d07321-9bba-4f08-a871-02e2af813b72"
]);
response, err := client.GetAction(
GetActionRequest{
UserId: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
Action: "signIn",
IdempotencyKey: "83d07321-9bba-4f08-a871-02e2af813b72",
},
)
Query Actions
API schema
const request = {
userId: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
// Optional filters
codes: "signIn,withdrawFunds", // Comma-separated list of action codes
fromDate: "2024-01-01T00:00:00Z", // ISO 8601 format
};
const actions = await authsignal.queryActions(request);
var request = new QueryActionsRequest(
UserId: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
Codes: "signIn,withdrawFunds", // Comma-separated list of action codes
FromDate: "2024-01-01T00:00:00Z" // ISO 8601 format
);
var actions = await authsignal.QueryActions(request);
QueryActionsRequest request = new QueryActionsRequest();
request.userId = "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833";
request.codes = "signIn,withdrawFunds"; // Comma-separated list of action codes
request.fromDate = "2024-01-01T00:00:00Z"; // ISO 8601 format
QueryActionsResponse actions = authsignal.queryActions(request).get();
actions = Authsignal.query_actions(
user_id: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
codes: "signIn,withdrawFunds", # Comma-separated list of action codes
from_date: "2024-01-01T00:00:00Z" # ISO 8601 format
)
actions = authsignal.query_actions(
user_id="dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
codes="signIn,withdrawFunds", # Comma-separated list of action codes
from_date="2024-01-01T00:00:00Z" # ISO 8601 format
)
$actions = Authsignal::queryActions([
'userId' => "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
'codes' => "signIn,withdrawFunds", // Comma-separated list of action codes
'fromDate' => "2024-01-01T00:00:00Z" // ISO 8601 format
]);
actions, err := client.QueryActions(
QueryActionsRequest{
UserId: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
Codes: "signIn,withdrawFunds", // Comma-separated list of action codes
FromDate: "2024-01-01T00:00:00Z", // ISO 8601 format
},
)
Update Action
API schema
const request = {
userId: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
action: "signIn",
idempotencyKey: "83d07321-9bba-4f08-a871-02e2af813b72",
attributes: {
state: "REVIEW_REQUIRED",
},
};
const updatedAttributes = await authsignal.updateAction(request);
var request = new UpdateActionRequest(
UserId: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
Action: "signIn",
IdempotencyKey: "83d07321-9bba-4f08-a871-02e2af813b72",
Attributes: new ActionAttributes(
state: UserActionState.REVIEW_REQUIRED
)
);
var updatedAttributes = await authsignal.UpdateAction(request);
UpdateActionRequest request = new UpdateActionRequest();
request.userId = "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833";
request.action = "signIn";
request.idempotencyKey = "83d07321-9bba-4f08-a871-02e2af813b72";
request.attributes = new ActionAttributes();
request.attributes.state = UserActionState.REVIEW_REQUIRED;
ActionAttributes updatedAttributes = authsignal.updateAction(request).get();
updatedAttributes = Authsignal.update_action(
user_id: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
action: "signIn",
idempotency_key: "83d07321-9bba-4f08-a871-02e2af813b72",
attributes: {
state: "REVIEW_REQUIRED"
})
updatedAttributes = authsignal.update_action(
user_id="dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
action="signIn",
idempotency_key="83d07321-9bba-4f08-a871-02e2af813b72",
attributes={
"state": "REVIEW_REQUIRED"
}
)
$attributes = array(
"state" => "REVIEW_REQUIRED",
);
$updatedAttributes = Authsignal::updateAction(
userId: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
action: "signIn",
idempotencyKey: "83d07321-9bba-4f08-a871-02e2af813b72",
attributes: $attributes);
updatedAttributes, err := client.UpdateAction(
UpdateActionRequest{
UserId: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
Action: "signIn",
IdempotencyKey: "83d07321-9bba-4f08-a871-02e2af813b72",
Attributes: &ActionAttributes{
State: "REVIEW_REQUIRED",
},
},
)

