11-05-2025 03:22 PM - edited 11-05-2025 03:23 PM
Hello everyone, I’m encountering an issue when trying to update device template variables via the vManage REST API.The API consistently returns an HTTP 400 Bad Request, even though the workflow follows Cisco’s documented process and mirrors the web UI “Change Device Values” operation. My goal is to automate template variable updates that are currently performed manually in the UI.
Step 1 – Authentication
POST /j_security_check and GET /dataservice/client/token → success
Step 2 – Retrieve Device Info
GET /dataservice/device → success
Step 3 – Get Template Info
GET /dataservice/template/device/config/attached/{templateId} → success
Step 4 – Get Current Variables
POST /dataservice/template/device/config/input → success, retrieved full variable list
Step 5 – Update Variables ( Failing )
POST /dataservice/template/device/config/attachfeature → failed, HTTP 400 Bad Request
Verified isEdited = true
Confirmed variable names match template fields
Ensured values are string type
Compared structure with working iTest automation payloads
Rechecked JSON against API documentation
Is the payload for /attachfeature missing any required fields or structure?
How can I get detailed error information for 400 responses?
Is this the right endpoint, or should a detach/attach sequence be used?
Does the web UI trigger additional backend calls that need to be replicated?
11-05-2025 10:58 PM
ohoy there @Moxa . Let me get my coffee, and try to give u an answer, as short as possible... loool.
Here we go: A 400 from /attachfeature usually means something in the payload doesn’t fully match what vManage expects, even small differences can cause it. A few things to check:
and dont forget that the web UI actually triggers the same endpoint but sometimes adds internal IDs or default fields missing from manual API calls. Comparing the browser network trace, when updating via the UI can help spot those differences.
hope it helps and PEACE!
-Enes
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide