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

30 views5 hours agoCreate Element DataAPI
0
Baranisudha Murugesan [DevOps Member]1.16K 14 hours ago 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 5 hours ago

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
0
Sebastian Ulloa [SLC] [DevOps Advocate]2.25K Posted 5 hours ago 0 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] Answered question 5 hours ago
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