HTTPError: 403 Client Error: Forbidden

67 views
Skip to first unread message

Magdalena Surówka

unread,
Sep 13, 2022, 8:10:53 AM9/13/22
to GeoAdminCh API
I am getting following error on api3.geo.admin.ch:

requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://api3.geo.admin.ch/rest/services/api/SearchServer?searchText=Christoffelgasse+5%2C+3003+Bern&type=locations

Any idea what could be the reason?

I have made sure the API limits are respected, but the problem persists.

David...@swisstopo.ch

unread,
Sep 13, 2022, 8:40:27 AM9/13/22
to geoadm...@googlegroups.com

Hi

If you search for https://api3.geo.admin.ch/rest/services/api/SearchServer?searchText=Christoffelgasse%205%20Bern&type=locations

Everything works fine

 

The official Zip is “Christoffelgasse 5 3011 Bern” 3003 is an auxillary zip which is not official

 

David

--
You received this message because you are subscribed to the Google Groups "GeoAdminCh API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geoadmin-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geoadmin-api/3e5478b1-6bd6-48a8-86b1-7d96d5d0855bn%40googlegroups.com.

Magdalena Surówka

unread,
Sep 15, 2022, 5:00:10 AM9/15/22
to geoadm...@googlegroups.com

Indeed it works in the browser. However, I am getting the error when sending requests via Postman or with a script. 

Are there any parameters that need to be defined in request headers? 

Full error trace is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>

<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The request could not be satisfied</TITLE>
</HEAD>

<BODY>
<H1>403 ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
Bad request.
We can't connect to the server for this app or website at this time. There might be too much traffic or a
configuration error. Try again later, or contact the app or website owner.
<BR clear="all">
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
<BR clear="all">
<HR noshade size="1px">
<PRE>
Generated by cloudfront (CloudFront)
Request ID: McxRi64PET8JL0KoDV5OAnimUrrKylxIbpWrmfkSAyBesytpNc91Lw==
</PRE>
<ADDRESS>
</ADDRESS>
</BODY>

</HTML>

You received this message because you are subscribed to a topic in the Google Groups "GeoAdminCh API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/geoadmin-api/8yIrwgQI0HU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to geoadmin-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geoadmin-api/9587b3c533854cb79a46e24ae0a345de%40swisstopo.ch.

David...@swisstopo.ch

unread,
Sep 15, 2022, 5:10:38 AM9/15/22
to geoadm...@googlegroups.com

Magdalena Surówka

unread,
Sep 15, 2022, 5:35:05 AM9/15/22
to geoadm...@googlegroups.com

Jürgen Hansmann

unread,
Sep 15, 2022, 5:56:49 AM9/15/22
to GeoAdminCh API
Hi Magdalena

Can you please add the full request (or the snippet, where you do the actual request)?
That would identifying the issue.

Thanks a lot and best regards
Juergen

Magdalena Surówka

unread,
Sep 15, 2022, 6:31:15 AM9/15/22
to geoadm...@googlegroups.com
Hi Jürgen

I managed to get it to work. The method update (post->get) didn't get saved.
Thank you for your support!

Magdalena


Jürgen Hansmann

unread,
Sep 16, 2022, 8:12:04 AM9/16/22
to GeoAdminCh API
Hi Magdalena

That's good to hear, have a nice weekend!

BR
Juergen
Reply all
Reply to author
Forward
0 new messages