Do we can create REST POST API extension in Bonita studio?

1
0
-1

Hi everyone,

Currently, in Bonita 2022.2 Community, could we have some ways to create REST API extensions has method POST?

I have tried with the sample introduced at here: Different HTTP Methods in Bonita REST Extensions - Evoke Technologies. But I always face 401 status with POST API, although I ran POST API in web browser tab had Bonita API token already (and, I can run with GET API on the same web browser tab).

This is my page.properties file for POST API:

#The technical name of the REST API extension
#Must be URL compliant (alpha-numeric characters with no whitespace) and be prefixed by "custompage_"
name=custompage_testRestAPI

#Name displayed in the Portal
displayName=test REST API

#Description displayed in the Portal
description=REST API to manage test

#Must be apiExtension for a REST API extension
contentType=apiExtension

#Declare at least one API extension here (comma-separated list)
apiExtensions=testRestAPI

#For each declared API extension, specify the
#following properties: method,pathTemplate,classFileName and permissions

#Specify one HTTP verb from GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS|TRACE
#GET is the recommended value for a REST API extension.
#Write operations should be performed by a process.
testRestAPI.method=POST

#Define the URL path template
#Resulting URL: ../API/extension/test
testRestAPI.pathTemplate=test

#Declare the associated RestAPIController class name
testRestAPI.className=com.truetech.rest.api.Index
#testRestAPI.classFileName=com/truetech/rest/api/Index.groovy

#Declare the permissions list (comma-separated list)
#For each permission declared, you must map it either to a profile (for example User, Administrator, or a custom profile) or to a specific user.
#Edit the custom-permissions-mapping.properties configuration file.
#For example: user|john=[add_test] or profile|User=[add_test]
#In production, use the platform-setup tool.
#In the studio, go to menu Development > REST API Extension > Edit permissions mapping.
testRestAPI.permissions=add_test

And, I configured the permission mapping, like this one:

profile|User=[read_employee_information, read_assets_information, add_test]

Hope receive someone's advices on this stuck.

Thank you so much,

Tam

No answers yet.
Notifications