My favorites | Sign in
Project Home Downloads Wiki Issues
Search
for
accounts_v2_1  
car2go API Documentation - Get all accounts
Updated Feb 6, 2012 by claus.na...@daimler.com

Get all accounts

Provides all valid accounts of a user for a given location like Ulm or Austin. Access to this function is restricted. See OAuth documentation for more details. The only supported HTTP method is GET.

Access: protected
URL: https://www.car2go.com/api/v2.1/accounts
Method: GET

Parameters

Name Mandatory Description
loc true location identifier string of the user's home location, e.g. "ulm", "austin".
format false defines response format. Value "json" => JSON format, otherwise xml format is used
callback false defines JSONP (JSON with Padding) callback function used as wrapper
test false activates test mode if set to "1". See below for more details.

Request Examples

GET https://www.car2go.com/api/v2.1/accounts?loc=ulm&format=json
GET https://www.car2go.com/api/v2.1/accounts?loc=austin

Response

The XML file defines a accountResponse tag to receive all valid accounts for any car2go user. The accountResponse tag

defines following sub tags:
  • returnValue - see list of return codes below and return values for more details
  • account - only for successful return value, i.e. code = 0. Contains a list of all found accounts with following sub tags:
    • accountId - the unique identifier of this account
    • description - detailed description of the account
  • Response Examples

    A XML response example where user has valid account:

     <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
     <accountResponse xmlns="http://www.car2go.com/openapi/xmlschema">
         <returnValue>
             <code>0</code>
             <description>Operation successful.</description>
         </returnValue>
         <account>
             <accountId>58</accountId>
             <description></description>
         </account>
     </accountResponse>
    

    A XML response example where user does not have valid account:

     <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
     <accountResponse xmlns="http://www.car2go.com/openapi/xmlschema">
         <returnValue>
             <code>3</code>
             <description>No valid accounts found.</description>
         </returnValue>
     </accountResponse>
    

    A JSON response example:

     {"returnValue":{"code":0,"description":"Operation successful."},"account":[{"accountId":994,"description":"Max Mustermann11585"}]}
    

    Test Mode

    Response contains two test accounts which can be used to create bookings in test mode.

    Return Codes

    The following return codes may occur:

    Code Description Note
    0 Operation successful.
    1 Location invalid.
    2 UserId invalid.
    3 No valid accounts found. The user has no valid accounts. This occurs when the user has no account and is not invited to any accounts.

    (c) 2010 car2go GmbH. All rights reserved. Generated 03.02.12 08:59


    Sign in to add a comment
    Powered by Google Project Hosting