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
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Implement a curl request in a HTTP session: Authentication issue with GET

Solved1.23K views7th July 2023restful
4
Dominique Bodart [DevOps Member]693 3rd February 2023 0 Comments

Hi,

Today, I need to send a GET request using an authentication bearer. I enter the token for the bearer in Parameter 150 but it looks like my HTTP Session below doesn't sent the authorization information. From the provider, the request in curl should be formated as follow:

curl - -location - -request GET 'https://api-knt.skylogic.com/ext/api/v1/whs/services' \ --header 'Authorization: Bearer <MY-ACCESS-TOKEN>' - -header 'Accept: application/json'

So, the problem I have here is how to implement the "--header 'Authorization: Bearer <MY-ACCESS-TOKEN>'"? Here follow my code for the HTTP Sessions. Session id="1" works fine and I put the authorization parameters as parameter as kind advised by Laurens. So tried something similar in Session id="2" which is supposed to sent my GET:

<HTTP>
<Session id="1" name="Get Token">
<Connection id="1" name="Get Token">
<Request verb="POST" url="/ext/api/v1/whs/oauth2/token">
<Parameters>
<Parameter key="grant_type">client_credentials</Parameter>
<Parameter key="client_id" pid="152" />
<Parameter key="client_secret" pid="153"/>
</Parameters>
<Headers>
<Header key="Content-Type">application/x-www-form-urlencoded</Header>
</Headers>
</Request>
<Response statusCode="100">
<Content pid="200" />
</Response>
</Connection>
</Session>

<Session id="2" name="Get Status">
<Connection id="2" name="Get Status">
<Request verb="GET" url="/ext/api/v1/whs/services/200396/subscriptions">
<Parameters>
<Parameter key="Authorization: Bearer" pid="150"/>
</Parameters>
</Request>
<Response statusCode="101">
<Content pid="201" />
</Response>
</Connection>
</Session>

</HTTP>

However, the answer I receive in this case is "Error 401, unauthorized access", as if the "<Parameter key="Authorization: Bearer" pid="150"/>" was not sent or wrongly formeted, maybe. So I will greatly appreciate your advice on this 🙂

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 7th July 2023

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
9
Jeroen Neyt [SLC] [DevOps Advocate]2.35K Posted 3rd February 2023 0 Comments

One issue that I'm noticing is the fact that Bearer is part of your header key which should actually be part of your header value. So the correct way of configuring this in the session would be:

<Header key="Authorization" pid="150"/>

And then prepend Bearer to the value you currently have stored in parameter 150.

So the content should look like Bearer <MY-ACCESS-TOKEN>

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 7th July 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