• 0 Vote(s) - 0 Average
  • 5
  • 4
  • 3
  • 2
  • 1
Thread Modes

Rest API authentication within URL
#1
Hello,

We are trying to use REST API with our PRTG Network Monitor tool.
When getting an alert on a specific device we want PRTG to create an EasyVista ticket.

To achieve that we need the login/password specified in the URL:
https://my_server/api/v1/50004/requests .....


We can create tickets using Postman seamlessly by using the basic authent.

How can we replace the Postman basic authent by including it in the URL?

Any help would be much appreciated.

Thanks in advance.


VLP

#2
(06-05-2018, 09:46 AM)VLP Wrote: Hello,

We are trying to use REST API with our PRTG Network Monitor tool.
When getting an alert on a specific device we want PRTG to create an EasyVista ticket.

To achieve that we need the login/password specified in the URL:
https://my_server/api/v1/50004/requests .....


We can create tickets using Postman seamlessly by using the basic authent.

How can we replace the Postman basic authent by including it in the URL?

Any help would be much appreciated.

Thanks in advance.


VLP

Hello,

"Authorization" field is a standard HTTP header field and processed differently than query parameters.
You should use SAOP GET/POST that allow login/pass in URL : https://wiki.easyvista.com/xwiki/bin/vie...ateRequest

P.ABBE
ABBE Philippe, proud to be a member of EV CONNECT FORUM since Nov 2015.

#3
(06-06-2018, 04:11 AM)ABBE Philippe Wrote:
(06-05-2018, 09:46 AM)VLP Wrote: Hello,

We are trying to use REST API with our PRTG Network Monitor tool.
When getting an alert on a specific device we want PRTG to create an EasyVista ticket.

To achieve that we need the login/password specified in the URL:
https://my_server/api/v1/50004/requests .....


We can create tickets using Postman seamlessly by using the basic authent.

How can we replace the Postman basic authent by including it in the URL?

Any help would be much appreciated.

Thanks in advance.


VLP

Hello,

"Authorization" field is a standard HTTP header field and processed differently than query parameters.
You should use SAOP GET/POST that allow login/pass in URL : https://wiki.easyvista.com/xwiki/bin/vie...ateRequest

P.ABBE

Hello Philippe,

Thanks for your reply.

I found a way out using Powershell (to use basic authentication) and passing parameters from our Network Monitor tool.

Everything is working fine now.

Have a good day.

Best regards,

VLP
VLP, proud to be a member of EV CONNECT FORUM since Feb 2018.

#4
(06-12-2018, 07:46 AM)VLP Wrote:
(06-06-2018, 04:11 AM)ABBE Philippe Wrote:
(06-05-2018, 09:46 AM)VLP Wrote: Hello,

We are trying to use REST API with our PRTG Network Monitor tool.
When getting an alert on a specific device we want PRTG to create an EasyVista ticket.

To achieve that we need the login/password specified in the URL:
https://my_server/api/v1/50004/requests .....


We can create tickets using Postman seamlessly by using the basic authent.

How can we replace the Postman basic authent by including it in the URL?

Any help would be much appreciated.

Thanks in advance.


VLP

Hello,

"Authorization" field is a standard HTTP header field and processed differently than query parameters.
You should use SAOP GET/POST that allow login/pass in URL : https://wiki.easyvista.com/xwiki/bin/vie...ateRequest

P.ABBE

Hello Philippe,

Thanks for your reply.

I found a way out using Powershell (to use basic authentication) and passing parameters from our Network Monitor tool.

Everything is working fine now.

Have a good day.

Best regards,

VLP

Hello,
Here example of code for Authorization:

Code:
$username = "WebService_Rest"
$password = "xxxxxxxxxxxxxxxxxxxxxx"

$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $username,$password)))


$invokeSplat = @{
   Uri    = "https://url/api/v1/50005/requests/ticket_number"
   Method = "Get"        
}

$headersSplat = @{
   Headers = @{
       ContentType = "application/json"
       Authorization = ("Basic {0}" -f $base64AuthInfo)
   }
}

P.ABBE
ABBE Philippe, proud to be a member of EV CONNECT FORUM since Nov 2015.






Users browsing this thread: 1 Guest(s)