Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.