OpenAPI Testing Support

59 views
Skip to first unread message

Claus Näveke

unread,
Feb 6, 2012, 3:33:45 AM2/6/12
to car2go OpenAPI
Hi all,

I just updated the OpenAPI Wiki for all V2.1 API calls: We introduced
a new testing functionality for all protected functions which allows
developers to test the API without requiring any special test
accounts.

Please let us know what you think of the testing mode!

Regards
Claus

PS: If you did not notice: Lyon and Duesseldorf just went live, so if
your app doesn't already support those cities it might be a good time
for an update ;-)

Andreas Kern

unread,
Feb 6, 2012, 5:06:36 AM2/6/12
to car2go-...@googlegroups.com
Hello Claus.

Thank you. This is a great tool for testing.

I have one question:
If I call the getBookings API request. The API will return me two bookings. One with a vehicle and one without. The value for the "vehicle" key is null in the second booking. I can remember that, the behavior of the 2.0 API was, that bookings without a vehicle didn't contain a "vehicle" key. Now there is a vehicle key with the value null. Was this behavior changed in the 2.1 API? Or is this a bug in the Testing API?

Greetings, Andreas.

Claus Näveke

unread,
Feb 7, 2012, 12:22:48 PM2/7/12
to car2go OpenAPI
On 6 Feb., 11:06, Andreas Kern <andreask...@mac.com> wrote:

Hi Andreas,

> I have one question:
> If I call the getBookings API request. The API will return me two bookings. One with a vehicle and one without. The value for the "vehicle" key is null in the second booking. I can remember that, the behavior of the 2.0 API was, that bookings without a vehicle didn't contain a "vehicle" key. Now there is a vehicle key with the value null. Was this behavior changed in the 2.1 API? Or is this a bug in the Testing API?

Are you referring to the JSON or XML Output? For JSON the null value
should be there with or without test=1 (for long term booking which do
not yet have an vehicle assigned). For XML there should not be a
vehicle key if the value is null.
This is not realy a consistent behaviour between the JSON and the XML
output, but it should be consistent between test and non test
requests.

Claus

Andreas Kern

unread,
Feb 9, 2012, 7:58:26 AM2/9/12
to car2go-...@googlegroups.com
Hi Claus.

Yes, I was talking about the JSON response. The last time I had the possibility to test the long term booking was with the 2.0 API. As I can remember the behavior was, that there wasn't a vehicle key. But it doesn't matter.
I found a bug in my code for the current API with the testing mode. So I want to thank you for this feature.

Regards, Andreas.

Reply all
Reply to author
Forward
0 new messages