14
Views
4
Comments
Solved
Expose Rest API error - method Get

Hi buddies,


I need to expose a Rest API.

I need to create a method Get where I used the Email of the Customer to show all the data about the Customer. 

This is what I did:


The method GetCustomer:

The action flow:

But when I use this method I get this error:

I don't know what I did wrong.

Can you help me?


Thank you!!!


Best regards,

FC

Rank: #94
Solution

Hello again Fábio,

Hope you're doing well.


It seems that you're just missing a slash "/" at the end.


Can you please try to use this URL instead:

https://askblue1.outsystemscloud.com/Sales_API/rest/v1/customers/anamaria@hotmail.com/

Basically after the Email, try to add a slash and test it again.


Hope that this helps you!


Kind regards,

Rui Barradas

Rank: #94
Solution

Hello Fábio,

Hope you are doing well.


Usually when you get a 404 (Not Found) error, it means that the server couldn't find the requested resource.

Can you please validate if the Request URL of the method that you're invoking is correct?


You can find the list of the methods and their respective URLs if you right click on top of the API and click in Open Documentation option:


Then you should be able to see the Request URLs for your methods (in my case, I have only one method called RESTAPIMethod1):


This is the correct URL that you should invoke :)


Hope that this helps you!


Kind regards,

Rui Barradas

Hi Rui,


Thanks for the explanation.


When I open the option "Open Documentation": 


Then I copy-paste that URL in the API tool and switch the email:

https://askblue1.outsystemscloud.com/Sales_API/rest/v1/customers/anamaria@hotmail.com 


I still have an error.

Honestly, I don't know what I'm doing wrong...

Do you know?


Best regards,

FC 


Rank: #94
Solution

Hello again Fábio,

Hope you're doing well.


It seems that you're just missing a slash "/" at the end.


Can you please try to use this URL instead:

https://askblue1.outsystemscloud.com/Sales_API/rest/v1/customers/anamaria@hotmail.com/

Basically after the Email, try to add a slash and test it again.


Hope that this helps you!


Kind regards,

Rui Barradas

Rui,


Works perfectly with the slash!!

It's solved.


Thank you so much.


Best regards,

FC