application.massadd

Description

object application.massadd(object **parameters**)

This method allows to simultaneously add multiple items to the given applications.

This method is only available to Admin and Super admin user types. Permissions to call the method can be revoked in user role settings. See User roles for more information.

Parameters

(object) Parameters containing the IDs of the applications to update and the items to add to the applications.

The method accepts the following parameters.

ParameterTypeDescription
applications
(required)
array/objectApplications to be updated.

The applications must have the applicationid property defined.
itemsarray/objectItems to add to the given applications.

The items must have the itemid property defined.

Return values

(object) Returns an object containing the IDs of the updated applications under the applicationids property.

Examples

Adding items to multiple applications

Add the given items to two applications.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "application.massadd",
  4. "params": {
  5. "applications": [
  6. {
  7. "applicationid": "247"
  8. },
  9. {
  10. "applicationid": "246"
  11. }
  12. ],
  13. "items": [
  14. {
  15. "itemid": "22800"
  16. },
  17. {
  18. "itemid": "22801"
  19. }
  20. ]
  21. },
  22. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  23. "id": 1
  24. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "applicationids": [
  5. "247",
  6. "246"
  7. ]
  8. },
  9. "id": 1
  10. }

See also

Source

CApplication::massAdd() in ui/include/classes/api/services/CApplication.php.