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
    • Empower Replay: Limited Edition
    • 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
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • 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)
    • DataMiner DevOps Professional Program
      • About the DevOps Program
      • DataMiner DevOps Support
  • Downloads
  • More
    • DataMiner Releases & Updates
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
      • General Inquiries
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

500 error in API with Dataminer Automation

Solved847 views25th May 2023
1
Yuki Arakawa(3496) 荒川 祐貴 [DevOps Advocate]855 25th May 2023 0 Comments

Hi Skyline Team

The API in DataMiner Automation added in 10.3.6.0 is interesting to me.

I tested it immediately.
I created a simple script to Pause and Start an element as Automation.

Created an endpoint in User-defined API
Of course, the token is created.

When I posted with Postman, it returned a 500 error.

I think this is a simple API that does not require an output, am I doing something wrong?

Wouter Van Robays [SLC] [DevOps Enabler] Answered question 25th May 2023

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
2
Wouter Van Robays [SLC] [DevOps Enabler]1.14K Posted 25th May 2023 0 Comments

Hi Yuki,

As Ive mentioned, the issue you have is indeed that only automation scripts with a single C#code block as action are supported. On top of that, the C# code block needs the OnApiTrigger entry point method. More info can be found here: https://docs.dataminer.services/user-guide/Advanced_Modules/User%20Defined%20APIs/Defining_an_API/UD_APIs_Defining_a_new_API.html

We actually have an example in our documentation that is somewhat similar to what you are trying to test, that you can use as a reference for creating your scripts to start and pause your element: https://docs.dataminer.services/user-guide/Advanced_Modules/User%20Defined%20APIs/Defining_an_API/UD_APIs_Examples.html#onapitrigger-method-with-dictionary-parsing-from-json

In the example above, we create an APÏ that changes a parameter value of an element. You could change this script to have the DataMiner ID and Element ID as parameters, and you could change the lines of code that change the parameter value to the following for stopping an element. Starting an element would be the same, only replace the Stop() method with the Start() method:

var element = engine.FindElement(dmaId, elementId);
element.Stop();

If for your use-case there is no need to send a response back to the user, you could just return a 204 (No Content) response code, with an empty response message:

return new ApiTriggerOutput()
{
ResponseBody = "",
ResponseCode = (int) StatusCode.NoContent
};

For your use-case, I would create only 1 automation script for the two APIs. You can create a condition in your script that checks the URL route it was triggered on, based on that info, you can either pause or start your element in the same automation script.

I hope this helps you further in exploring the user-defined APIs feature!

Wouter Van Robays [SLC] [DevOps Enabler] Answered question 25th May 2023
You are viewing 1 out of 2 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

© 2025 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