Showing results for 
Search instead for 
Did you mean: 

Re: REST API for adding/removing child data sources?

I've added "childType": 2 to the JSON, now I'm getting "ERROR_CannotAddAgent (758)". Tried adding more parameters until the body looked like your example, one at a time, finally got this:


{"datasource": {"parentId": "144121785330171904", "name": "API Test2", "id": "", "typeId": 130, "childEnabled": false, "childCount": 0, "childType": 2, "ipAddress": "", "zoneId": 0, "idmId": "", "url": "", "enabled": false, "parameters": [{"key": "autolearn", "value": "count"}]}}


Got the same error. Tried to remove parameters, no change. The user has Admin rights and can add parents, the parent ID I got from


"typeName": "Juniper Secure Access/MAG",
"parsing": true,
"inSync": false,
"elmLogging": "no",
"typeId": 130,
"id": "144121785330171904",
"name": "Bremote1"


What am  I doing wrong?

McAfee Employee TaskManager
McAfee Employee
Report Inappropriate Content
Message 12 of 14

Re: REST API for adding/removing child data sources?

I'm curious if it may be a bug. My testing was done under the NGCP account credentials. Can you test the same code with the different permission set and see if it alters the results.

I am not seeing anything stand out that would cause issues. My testing has been done in 11.1.2, and I am submitting my query to the v2 API (https://esm.ip/rs/esm/v2/dsAddDataSource)

Re: REST API for adding/removing child data sources?



I'm using API v2 as well, but on ESM v. 10.3.4. I tried with the NGCP credentials, got the same error. Tried with a minimal JSON:

{"datasource": {"parentId": "144121785330171904", "name": "API Test2", "typeId": 130, "childType": 2, "ipAddress": "", "enabled": false}}


No joy. But then I thought to try a different parent:

"typeName": "Juniper Secure Access/MAG",
"parsing": false,
"inSync": false,
"elmLogging": "no",
"typeId": 130,
"id": "144121785313394688",
"name": "Bremote2-old"


That's a twin of the original parent that had been disabled a long time ago. Well, the same API call worked! It now has a child called "API Test2". Tried again, with a different name and IP, and a 2nd child was added. I tried with my own credentials on a childless data source and it worked as well. Then I tried to add a child to a 4th data source, one that, like the original one, already had a child, and again got the "ERROR_CannotAddAgent (758)".


So I can add childs, but only if the DS is childless.


Reliable Contributor brenta
Reliable Contributor
Report Inappropriate Content
Message 14 of 14

Re: REST API for adding/removing child data sources?

You can add multiple datasources (agents/clients) at the same time with dsAddDataSourceList

More McAfee Tools to Help You
  • Subscription Service Notification (SNS)
  • How-to: Endpoint Removal Tool
  • Support: Endpoint Security
  • eSupport: Policy Orchestrator
  • Community Help Hub

      New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

    • Find Forum FAQs
    • Learn How to Earn Badges
    • Ask for Help
    Go to Community Help

    Join the Community

      Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

    • Get helpful solutions from McAfee experts.
    • Stay connected to product conversations that matter to you.
    • Participate in product groups led by McAfee employees.
    Join the Community
    Join the Community