agilePointAPI
This section gives information about the JavaScript methods that can call the AgilePoint REST API methods from an eForm.
Background and Setup
Other Examples
- (Example) Use Custom JavaScript in an eForm
- JavaScript Methods for eForm Builder - Examples for JavaScript methods that are available out-of-the-box (OOTB) in AgilePoint NX.
Prerequisites
- AgilePoint NX v8.0 Software Update 1 and higher
Good to Know
- Any AgilePoint REST API method can be called with JavaScript in an eForm.
For more information, refer to Methods for REST API
- The JavaScript method to call an AgilePoint REST API method depends on whether
the API method is a GET or POST type method.
- For GET methods, use agilePointAPI.get .
- For POST methods, use agilePointAPI.post .
- The JavaScript syntax for calling an AgilePoint API method from an eForm is different
from calling an API method from an external system.
Refer to More Information on this page.
agilePointAPI.get
Method Type
Description
Retrieves data from AgilePoint Server using the REST APIs.
Parameters
The method input is an object with these parameters, and a callback function.
Field Name | Definition |
---|---|
relativePath |
|
apiOptions |
|
Output
A result object that gives the status, data, and error details.
Field Name | Definition |
---|---|
isSuccess |
|
data |
|
error |
|
status |
|
statusText |
|
url |
|
Example
var options = {};
// The value Admin/GetRegisterUsers shows
// the relative path of the Get Registered User by Name method.
options.relativePath = "Admin/GetRegisterUsers";
// The API options required to retrieve the data from the specified path.
// Example: headers, referrer, mode, cache, redirect.
options.apiOptions = {};
eFormHelper.agilePointAPI.get(options, function (result)
{
// Checks if the method is successful.
if (result.isSuccess)
{
// Logs the data retrieved from the Get API method.
console.log(result.data);
}
else
{
// Logs errors and error descriptions.
console.log(result.error);
}
});
agilePointAPI.post
Method Type
Description
Sends data to AgilePoint Server using the REST APIs to create or change resources.
Parameters
The method input is an object with these parameters, and a callback function.
Field Name | Definition |
---|---|
relativePath |
|
apiOptions |
|
Output
A result object that gives the status, data, and error details.
Field Name | Definition |
---|---|
isSuccess |
|
data |
|
error |
|
status |
|
statusText |
|
url |
|
Example
var options = {};
// The value Admin/GetRegisterUser shows
// the relative path of the Get Registered User by Name method.
options.relativePath = "Admin/GetRegisterUser";
// The value indicates the user name for the user to add.
options.data = { "userName": "TestUser" };
// The API options required to retrieve the data from the specified path.
// Example: headers, referrer, mode, cache, redirect.
options.apiOptions =
{
headers: {"Content-Type": "application/json;"}
};
eFormHelper.agilePointAPI.post(options, function (result)
{
// Checks if the method is successful.
if (result.isSuccess)
{
// Logs the data retrieved from the POST API method.
console.log(result.data);
}
else
{
// Logs errors and error descriptions.
console.log(result.error);
}
});
More Information
This section provides background information for the agilePointAPI methods.
Example: API Method Called from an eForm
Authentication and heeaders are not required when you call an AgilePoint API from an eForm with the JavaScript methods from eForms:
var options = {};
// The value Admin/GetRegisterUsers shows
// the relative path of the Get Registered User by Name method.
options.relativePath = "Admin/GetRegisterUsers";
// The API options required to retrieve the data from the specified path.
// Example: headers, referrer, mode, cache, redirect.
options.apiOptions = {};
eFormHelper.agilePointAPI.get(options, function (result)
{
// Checks if the method is successful.
if (result.isSuccess)
{
// Logs the data retrieved from the Get API method.
console.log(result.data);
}
else
{
// Logs errors and error descriptions.
console.log(result.error);
}
});
Example: API Method Called from an External App
Authentication and headers are required before a standard JavaScript API method call:
btnGetRegisterUsers").click(function () {
$.ajax({
url: "https://mydomain:9011/AgilePointServer/Admin/GetRegisterUsers",
type: "GET"
});
});
Code Examples in the AgilePoint NX Documentation
The AgilePoint NX Product Documentation is intended as a basic reference to help you understand how to complete basic coding tasks, such as make API or JavaScript method calls. Code examples that show specific use cases, the solutions to specific business problems, or detailed implementation scenarios are outside the scope of the AgilePoint NX Product Documentation. For specific and/or advanced types of examples that may better meet your requirements, AgilePoint provides several resources:
- AgilePoint Community Forums - A free, AgilePoint-moderated, crowd-sourcing user forum where you can ask questions about specific techniques, the solutions to use cases, workarounds, or other topics that may not be covered in the Product Documentation.
- Professional Services - If you can not find the information you need for your specific business problem, mentoring is available through AgilePoint Professional Services.
- Personalized Training - AgilePoint can provide personalized training for your organization. To request personalized training, contact AgilePoint Sales.