Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Write your logic to just be the code within a function
  • Your logic should return a javascript object
  • The framework will run your logic and return this object back to the caller - as jsonin JavaScript Object Notation (JSON)
  • For advanced usages : you do have can access to the node express request and response objects within this code block.
  • If you send your own response , the framework will not send anythingnothing.

In your code block, you can do whatever is needed, including, but not limited to:

  • Interact with databases: Using internal APIs such as pjs.data or pjs.query()
  • Interact with IBMi IBM i programs: Using pjs.call()
  • Interact with node.js packages
  • Interact with external web services
  • Interact with other modules/programs

...

5. Input Parameters section: This is where you will define all the inputs for the selected API.Most API will require some type of input parameters.  Here is where you can define, order, , as well as order and document them.

  • All parameters are validated before running any of the API logic.
  • You can also add nested child parameters.  Simply add a body parameter with the type "object", select it, and click the add parameter icon again. This new parameter dialog will not ask where the parameter is coming from because the designer already knows that it will be from that parent body parameter.
  • You can also drag-and-drop the parameters to order them as you like.The dragged parameter will be moved based on where you drop it.  If you drop it on the top half of another parameter, it will be placed before that parameter; else, it will be after that parameter.

For each parameter you define, you can specify:

...