Using the API to populate custom fields
Hello, I was not able to find much on the subject so I'm posting here
I'm currently trying to populate a custom field on my agent using the Atera API
The field is named "Waranty coverage" it's a date field that will be containing the Waranty end date of the machine (I'm pulling the Waranty data from the Dell API).
From the API doc website (https://app.atera.com/apidocs#/) I'm able to get the current value of the field using this endpoint /api/v3/customvalues/agentfield/{agentId}/{fieldName}
Which give me the following result:
However I was not able to find what I'm supposed to put into the body of the request to update the value when using the endpoint with the PUT method
The only hint given by the documentation is this :
I've try everything I could think of and only got errors
I hope you guys will be able to help me with this
Thank you in advance
Comments
-
Hi @support-info! I haven’t tried this yet, but is this something that the Atera AI could pull for you?
1 -
Hi @support-info - I have created a Support Ticket for you, ticket #420040.
1 -
I haven't thought of that, I will try it
0 -
Thank you for your help, I will post the final script here if I can make it work
BTW this could also be a nice additionnal feature for Atera to be able to pull the waranty information of the machine, since we are almost all using mainly Dell, Lenovo and HP devices, this would be a great asset managment feature0 -
I was finaly able to update the custom field
I was using the wrong date format …
The correct date format was "yyyy-MM-dd"
This bellow work:
Thank you for your help3 -
Glad it's working now! Yay!
1 -
I'm curious to know if you've got a working script? We're also using Dell.
Would be nice to ditch the cost of ScalePad..
0 -
Hey @anton
I got a working script, I will try to clean it up a bit and upload it here asap
I will also give some instruction on how to use it but it's prettry straight forward0 -
Here is the script I have made @anton
Here are the script requierments:
1. An Atera API key (You can generate one here:https://app.atera.com/new/admin/api)
2. Two Atera custom agent fields (You can create them here: https://app.atera.com/new/admin/dynamicfields)
3. An Access to the Dell Api (Dell Warranty API Version) (you can get that here: )
The script need no external module, it mainly use Invoke-webrequest.
It does not need admin permission to run.
All the script parametters can be set at the begining of the script (line 9 to 14)
It perform the following actions:
1. Get all the agent and export them to a csv file named : AteraAgentFullRawExport.csv
2. Get the Warranty for all the agent and export the list to a csv file named: AteraCleanWithWaranty_updateList.csv
3. Update all the Warranty and purchase date field on Atera
4. Export all the agent that were updated without issue
The custom fields look like this (sorry my Atera is in french)
How to run the script:
1. Unzip the script
2. Set the requiered parametters (line 9 to 14)
3. Put the script in a folder where you have the permission to create file (other wise the script will not be able to generate the csv reports)
4. Run and wait
If you need any help feel free to tag me here, I will be happy to help
this code not perfect, I'm far from a Powershell export and I will be happy to get any feed back on it !
One more thing: sometimes the dell laptop have multiple warranty plan for the device.
My script only pick the waranty with the furthest expiration date.1 -
Awesome! Thank you @support-info! My knowledge with powershell is limited but im super grateful for you instructions. Looks like I can figure this out :)
1 -
I followed the instructions but was getting an error because of the UTF8bom format and changed it to UTF8. The script ran fine but the custom fields are not populating.
0 -
If you havent tried already- then have a go with Powershell 7.
1
Topics
- All Topics
- 41 Getting started
- 25 Read before posting
- 8 Meet and greet
- 245 General
- 67 News and announcements
- 2 Swag
- 1 Roadmap updates
- 80 Resources
- 12 Knowledge Base
- 17 Webinars
- 1 Shared Script Library
- 2 Blog
- 19 Pro Tips
- 27 Got an idea?
- 3 Atera Academy
- 2 ActionAI
- 1 Copilot
- 140 Remote Monitoring and Management
- 84 Remote Monitoring
- 27 Patch Management
- 106 Professional Services Automation
- 65 Helpdesk
- 17 Billing
- 21 Reporting
- 39 Integrations & add-ons
- 21 Integrations
- 11 Add-ons
- 105 Scripting and automations
- 62 Scripts
- 30 Automations