82
Views
3
Comments
Consume API 401 Unauthorized
Question

I'm trying to send SMS through Consume API.

Even the test was successful. In fact, SMS is continuously received in the test. [Screen 1]


In other words, confirm that there are no problems with headers and body.


However, if you proceed through Publish, 401 Unauthorized occurs.

I've been wasting a lot of time on this problem for almost a week now. And it's possible because it's a free account.

I made a new revision two days ago and tried again, but 401 Unauthorized occurred again. [Screen 2]


I am writing this down so that the parts of my experience that follow are clear.


Aggregate is the problem,

Or is the problem caused by a security issue due to API disclosure due to the Anonymous setting? I do not know

I even looked at the Japanese site. It appears to have the same symptoms as above.


In other words, it is expected that it occurs due to a problem unrelated to the actual SMS API.


{

     "versionInfo": {

         "hasModuleVersionChanged": false,

         "hasApiVersionChanged": false

     },

     "data": {},

     "exception": {

         "name": "ServerException",

         "specificType": "System.Exception",

         "message": "401 Unauthorized"

     }

}



{versionInfo: {hasModuleVersionChanged: false, hasApiVersionChanged: false}, data: {},… }

data: {}

exception: {name: "ServerException", specificType: "System.Exception", message: "401 Unauthorized"}

message: "401 Unauthorized"

name: "ServerException"

specificType: "System.Exception"

versionInfo: {hasModuleVersionChanged: false, hasApiVersionChanged: false}

hasApiVersionChanged: false

hasModuleVersionChanged: false


{

"Message": "The requested resource does not support http method 'GET'."

}

The most likely cause [Screen 3 & Screen 4] may not be the case.


Error detail [Screen 5]

If anyone knows the solution, please respond.


Below are reference images. Thank you for reading the short article to the end. Have a nice day. ^^






20231004_234656_5.jpg
20231004_234656_4.jpg
20231004_234656_3.jpg
20231004_234656_2.jpg
20231004_234656_6.jpg
UserImage.jpg
vikas sharma
Champion

Hi

From screenshot its clear that while testing its working fine. But at runtime its not working and giving 401. Most probably at runtime not getting proper values of params in the request. I suggest to debug the API request.

regards

2020-09-21 11-35-56
Sachin Waghmare

Hello,

If possible, please share your OML to look into the issue. If not please refer the below posts and try different solutions suggested in them. 

https://www.outsystems.com/forums/discussion/59270/api-authorization-error/

https://www.outsystems.com/forums/discussion/54079/401-error-which-i-do-not-understand/

Please enable the full logging as steps mentioned into the below post and see if you get some help to get closed to your issue.

https://www.outsystems.com/forums/discussion/33272/setting-logging-level-of-a-rest-api/

Thanks,

Sachin

UserImage.jpg
Alexandre Yip

Hi Jung Sung Hwan, 

When you did the test on Os Test screen in tab "headers and authentication" did you provide any kind of authentication information? 

Error 401 refers to missing authentication, such as a password or invalid authentication credentials

If so provide it during your request. 

Hope that it helps you 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.