Skip to content
DataMiner Dojo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • YouTube Videos
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Agility
      • Learn more about Agile
        • Agile Webspace
        • Everything Agile
          • The Agile Manifesto
          • Best Practices
          • Retro Recipes
        • Methodologies
          • The Scrum Framework
          • Kanban
          • Extreme Programming
        • Roles
          • The Product Owner
          • The Agile Coach
          • The Quality & UX Coach (QX)
      • Book your Agile Fundamentals training
      • Book your Kanban workshop
    • >> Go to DataMiner Docs
  • DevOps
    • About the DevOps Program
    • Sign up for the DevOps Program
    • DataMiner DevOps Support
    • Feature Suggestions
  • Downloads
  • Swag Shop
  • PARTNERS
    • Business Partners
    • Technology Partners
  • Contact
    • Sales, Training & Certification
    • DataMiner Support
    • Global Feedback Survey
  • >> Go to dataminer.services

Error While trying to create Element from DataAPI PutAsync call

183 views8th June 2026Create Element DataAPI
0
Baranisudha Murugesan [DevOps Member]1.16K 8th June 2026 0 Comments

Using DataAPI im trying to create an element.

Im using the existing skyline repo as reference for this - SLC-UDAPI-DataAPI-Proxy

Below is the api call code and also im adding the screenshot of error im getting.

private static (HttpStatusCode statusCode, string response) PushDataToLocalApi(string url, Dictionary<string, string> headers, string body, IEngine engine)
{
var content = new StringContent(body, Encoding.UTF8, "application/json");

foreach (var header in headers)
{
engine.GenerateInformation($"Header Key [{header.Key}");
engine.GenerateInformation($"Header Value [{header.Value}");
content.Headers.Add(header.Key, header.Value);
}

var result = sharedClient.PutAsync(url, content).Result;
string responseBody = result.Content.ReadAsStringAsync().Result;

engine.GenerateInformation($"Data API Response [{result.StatusCode}]: {responseBody}");
engine.GenerateInformation($"Request URL: {sharedClient.BaseAddress}{url}");

return (result.StatusCode, responseBody);
}

Im getting 401 error, but PutAsync is not accepting any token. Can anyone help me resolve this?

Sebastian Ulloa [SLC] [DevOps Advocate] Answered question 8th June 2026

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
0
Sebastian Ulloa [SLC] [DevOps Advocate]2.30K Posted 8th June 2026 2 Comments

Hi Baranisudha Murugesan,

While the code does not need to handle a token, this must be configured in the User-Defined APIs in the system center.
For each custom endpoint you will need at least one token configured. See: Defining a new API | DataMiner Docs

Most likely, the token you have is not correct or it is not correctly linked to the UDAPI for creating elements.

Sebastian Ulloa [SLC] [DevOps Advocate] Posted new comment 9th June 2026
Baranisudha Murugesan [DevOps Member] commented 9th June 2026

Token is correctly passed. This same PutAsync is working with different cluster (awsdmat501a). Im not getting 401 error in that DM cluster. I can see the element is created with the payload data i have sent through postman. Im not sure whats missing in awsdmat601a cluster

Sebastian Ulloa [SLC] [DevOps Advocate] commented 9th June 2026

Hi Baranisudha,
A couple of things to clarify that might help narrow this down:

– Are awsdmat501a and awsdmat601a part of the same DMS, or are they configured as agents in different DMS environments?

– If they belong to different DMS setups, then the token must be defined separately per DMS, and a token from one will not work in the other.

If they are part of the same DMS:

– Are you invoking the exact same endpoint in both cases (e.g., /custom/data/parameter/)?
– If the endpoints differ, make sure the token is correctly configured and linked to each specific User-Defined API endpoint involved.
– Since you mentioned using PutAsync, I just want to confirm that the request is indeed targeting the same endpoint in both clusters.

If both agents are within the same DMS and you are using the same endpoint and token, but the issue persists on awsdmat601a, I would recommend reaching out to support@dataminer.services for further investigation, as this may indicate an environment-specific configuration issue.

You are viewing 1 out of 1 answers, click here to view all answers.
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2026 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin