Consistently getting `Internal Error`

7 views
Skip to first unread message

zeuben

unread,
Jul 7, 2010, 1:29:48 PM7/7/10
to GeoAPI
I'm trying to create a user-entity -- as far as i can see i'm doing
everything as listed in the docs, as well as listed in this group --
can anyone help?

here is my POST data in both JSON and PHP array:

{"name":"user-xed9REJotk-6c300461","type":"user-entity","geom":
{"type":"Point","coordinates":[[-73.987121,40.716077]]}}

stdClass Object
(
[name] => user-xed9REJotk-6c300461
[type] => user-entity
[geom] => stdClass Object
(
[type] => Point
[coordinates] => Array
(
[0] => Array
(
[0] => -73.987121
[1] => 40.716077
)

)

)

)

CURL REQUEST
$entity_name = "user-".GEOAPI_KEY."-".$V->getName();
$c = curl_init();
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_HTTPHEADER, array("Accept: application/
json", "Content-Type: application/json"));
curl_setopt($c, CURLOPT_URL, "http://api.geoapi.com/v1/e/".
$entity_name."?apikey=".GEOAPI_KEY);
curl_setopt($c, CURLOPT_POSTFIELDS, $entity_data);
$content = curl_exec($c);
curl_close($c);

GIVES RESPONSE

stdClass Object
(
[error] => you've encountered an internal error :-( please contact
a...@geoapi.com if it persists
)

Jason Schwartz

unread,
Jul 13, 2010, 8:00:03 PM7/13/10
to GeoAPI
I don't think it's your code. I am constantly getting internal error
on calls that work sometimes.

Is anyone from GeoAPI still monitoring? What's going on?

Othman Laraki

unread,
Jul 13, 2010, 9:37:34 PM7/13/10
to geo...@googlegroups.com
I believe that the problem you are seeing is because you are setting the coordinates for your point to be a two-dimensional array. Try POST'ing:

{"name":"user-xed9REJotk-6c300461","type":"user-entity","geom":
{"type":"Point","coordinates":[-73.987121,40.716077]}}

--
--------------------------------------------------------------------
Othman Laraki | http://twitter.com/othman

Jason Schwartz

unread,
Jul 13, 2010, 11:31:19 PM7/13/10
to GeoAPI
I tried this query 20 times with a 50% success rate.

http://api.geoapi.com/v1/e/new-york-ny/keyword-search?apikey=demo&pretty=1&q=%22my%20moon%22

50% of the time it returned this

{
"error": "you've encountered an internal error :-( please contact
a...@geoapi.com if it persists"
}

On Jul 13, 9:37 pm, Othman Laraki <oth...@gmail.com> wrote:
> I believe that the problem you are seeing is because you are setting the
> coordinates for your point to be a two-dimensional array. Try POST'ing:
>
> {"name":"user-xed9REJotk-6c300461","type":"user-entity","geom":
> {"type":"Point","coordinates":[-73.987121,40.716077]}}
>

Alessandro

unread,
Jul 14, 2010, 11:18:29 AM7/14/10
to geo...@googlegroups.com
THAT WORKED!

so when its a single point, rather than a polygon, you have to use a 2-D array, rather than a 3-D array for the polygon.

thanks!!

Alessandro

unread,
Jul 14, 2010, 12:23:24 PM7/14/10
to geo...@googlegroups.com
OK -- so now its not erroring -- but when i get the shorturl back in the result --


stdClass Object
(
[query] => stdClass Object
(
[type] => entity
[params] => stdClass Object
(
[guid] => user-xed9REJotk-6c300461
[show-geom] => all
)

)

[result] => stdClass Object
(
[name] => user-xed9REJotk-6c300461
[views] => Array
(
[0] => weather
[1] => foursquare
[2] => twitter
[3] => flickr
[4] => youtube
)

[userviews] => Array
(
)

[shorturl] => http://geo.am/KhK9Fw

[geom] => stdClass Object
(
[type] => Point
[coordinates] => Array
(
                            [0] => -73.986448
[1] => 40.71642
)

)

[type] => user-entity
)

)
and go to the shorturl (http://api.geoapi.com/e/user-xed9REJotk-6c300461) -- i get this:

That link is invalid or no longer exists.

so what does that mean?

Othman Laraki

unread,
Jul 15, 2010, 12:59:12 AM7/15/10
to geo...@googlegroups.com
Seems like our shorturl resolver has a bug. It's resolving to


instead of 


As in '/v1' is missing. Please use the long form until we get that fixed.

-Othman
Reply all
Reply to author
Forward
0 new messages