URL Validation

  

Hello,


I have one question: I need to validate one URL. So, I need that if the URL is unavailable I can catch that exception. There is any function like IsValidURL() that return something that I can handle?


Thank you!


Best regards,

Ricardo

Hi Ricardo,

One possible solution is to use the "HTTPGet" action from the ardoHTTP component from the Forge to perform a GET passing in your URL. You can wrap this in an Action in your eSpace with a boolean "Success" output parameter. If the call is successful, assign True to the output parameter. Drop an exception handler in your action and in its flow assign False to the output parameter.

Ok Aurélio!

Thank you! I'll try that and later I tell if it worked!


Cheers!

Hi!

I tested it but it retrieve me always status 401. I inspected the page and even when that url retrieve status 200 that action retrieve 401. 

I'm using that to get the office365 photo, so, if that URL retrieve different of 200 I put a generic photo. In this moment, 401 put the generic photo.

Am I doing this wrong?


Thanks!


Ricardo

Hi Ricardo,

Sorry for the late reply.

401 is an authorization error. That means that you're not properly authenticated in order to access the resource. I'm not really sure how authentication works in Office 365, but you could try to use an Authorization header in your GET request ("Headers" input parameter of the HTTPGet action).

Thanks Aurelio!


I'll try that!


Best regards,

Ricardo