custom app external api response not working
HSNM Front-end Welcome Portal general discussion about HTML, CSS, layout, custom apps, templates

Rate this topic
   Post Reply
8 posts   •   Page 1 of 1
miami1983
Posts: 81
Joined: 17 Apr 2019, 09:08

custom app external api response not working

by miami1983 » 14 Sep 2022, 09:34

Hi ,
we build custom app to integrate with API server for : user need to enter his mobile number , the API server will get the user response , check his balance and recharge his hsnm user

but using the API url inside the custom app , not provide us the response as normal using in browser

the error we observe :
from origin 'http://wifi.ps' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'.

after set no-cors in the custom app .. the API integration working and recieve transaction to external server , but without response

method: 'GET',
cache: 'no-cache',
mode: 'no-cors',

and the response are : "failed to load response data : NO data found for given resource with given identifier "

how we can solve it while we try all things :

HSNMSupport
Posts: 1553
Joined: 26 Jul 2016, 09:16

Re: custom app external api response not working

by HSNMSupport » 14 Sep 2022, 11:16

Hi
If calling the API through a web browser it works but it didn't work on your APP, it means that there was something wrong on your APP
In addition to that, the error your provided (".... 'http://wifi.ps' has been blocked by CORS policy: Response to preflight request doesn't pass access control check:....") is not an error provided by our system

Best regards

miami1983
Posts: 81
Joined: 17 Apr 2019, 09:08

Re: custom app external api response not working

by miami1983 » 25 Sep 2022, 14:05

Hi
If calling the API through a web browser it works but it didn't work on your APP, it means that there was something wrong on your APP
In addition to that, the error your provided (".... 'http://wifi.ps' has been blocked by CORS policy: Response to preflight request doesn't pass access control check:....") is not an error provided by our system

Best regards
can you help me how i can solve it .. i try all of choices

HSNMSupport
Posts: 1553
Joined: 26 Jul 2016, 09:16

Re: custom app external api response not working

by HSNMSupport » 26 Sep 2022, 09:16

It is not possible for us, to give you support on your platforms.
S.T.

miami1983
Posts: 81
Joined: 17 Apr 2019, 09:08

Re: custom app external api response not working

by miami1983 » 12 Dec 2022, 14:30

It is not possible for us, to give you support on your platforms.
S.T.
i change the method by using error cause code 200 for OK and 500 for error
but when inspect the result over HSNM hotspot portal login for custom app , its detect the response from console as 0 all the time

and not detect the network error i send ..

just to understand the scenario . i have ASP.net IIS API server working with all normal browsers and API servers connected to multi supplier .. the problem only on your system which i need to integrate it with mobile operator

the API link provided from my API server is working and can doing charging systems ,, but when using on custom app and try to catch the response we can't have it

HSNMSupport
Posts: 1553
Joined: 26 Jul 2016, 09:16

Re: custom app external api response not working

by HSNMSupport » 12 Dec 2022, 14:35

We have documentation for Integrations with HSNM.
We do no give support for .NET.
Please check your own code.
S.T.

miami1983
Posts: 81
Joined: 17 Apr 2019, 09:08

Re: custom app external api response not working

by miami1983 » 14 Dec 2022, 13:07

We have documentation for Integrations with HSNM.
We do no give support for .NET.
Please check your own code.
S.T.
I use php API server with the same error .. i can't read the response in the console it give me "null" in the body

so we need help

HSNMSupport
Posts: 1553
Joined: 26 Jul 2016, 09:16

Re: custom app external api response not working

by HSNMSupport » 09 Jan 2023, 17:02

The problem has been solved.
This issue was caused by a wrong configuration of the server hosting the API called.
They added the right CORS policy and the remote call from the HSNM app started working.
S.T.

Rate this topic

Who is online

Users browsing this forum: No registered users and 13 guests

It is currently 23 Nov 2024, 09:02