UsersAPI
API in API Gateway console./users/{userId}
resource.Create method
.Create method
page - Method details
section:Method type
: Select UPDATE
.update-user
function.Keep other settings as default.
Create method
.You will be redirect to the detail of the /users/{userId} - PATCH
method.
Integration request
tab.Integration request settings
section, click Edit
.Edit integration request
page, expand the URL path parameters
section:Add path parameter
.Name
: Fill in userId
.Mapped from
: Fill in method.request.path.userId
.Mapping templates
section:Click Add mapping template
.
Content type
: Fill in application/json
.
Template body
: Fill in:
## Parse the request body into a JSON object
#set($inputRoot = $input.path('$'))
{
#foreach($key in $inputRoot.keySet())
"$key": "$util.escapeJavaScript($inputRoot.get($key))"#if($foreach.hasNext),#end
#end,
"id": "$input.params('userId')"
}
Save
.