This PR implements support for API points with a Scripted REST API. This API is bound to a specific role ACL, and allows invocation with varying payloads. This resolves #2.
Invocation
The SR API endpoint is /api/x_snc_pointsthing/points_thing/api_point and this accepts a POST with Content-Type application/json. The payload is formatted as follows:
Only the reason, target, and targetType keys are mandatory.
Target type accepts slack_id or name.
Points will be ignored if the value is NaN or a negative integer.
Sender translates to Giver, and takes a user_name.
If ignored, this will fall back to a global property, slacker.api_point_giver, which you can use if you would like to have points reflecting their source.
Sample Call
POST /api/x_snc_pointsthing/points_thing/api_point HTTP/1.1
Content-Type: application/json
Host: instance.service-now.com
I also added a Points field to the API Points table, tweaked the lists slightly, and extended the PointsThing SI for API-specific methods/behaviour. Because of who I am I also added a semicolon on a line in PointsThing because the linter warning bothered me.
This PR implements support for API points with a Scripted REST API. This API is bound to a specific role ACL, and allows invocation with varying payloads. This resolves #2.
Invocation
The SR API endpoint is
/api/x_snc_pointsthing/points_thing/api_point
and this accepts a POST with Content-Typeapplication/json
. The payload is formatted as follows:Payload notes
slack_id
orname
.slacker.api_point_giver
, which you can use if you would like to have points reflecting their source.Sample Call
POST /api/x_snc_pointsthing/points_thing/api_point HTTP/1.1 Content-Type: application/json Host: instance.service-now.com
{ "reason": "Testing", "target": "U0K4BD8DC", "targetType": "slack_id", "points":2 }
Notes
I also added a Points field to the API Points table, tweaked the lists slightly, and extended the PointsThing SI for API-specific methods/behaviour. Because of who I am I also added a semicolon on a line in PointsThing because the linter warning bothered me.