Server::getUser

This method returns a constituent record. Use this method when calling from another application or server.

Post URL

Deconstructing the URL
*
In most cases secure2.convio.net matches a client's secure domain.  However, in some cases this will be different.  If your organization uses Convio for fundraising, the correct secure domain for the API is identical to the secure domain for your fundraising forms.  So if the sample above does not work, look for the unique secure domain used for your organization and replace the secure2.convio.net portion above with this URL. 

*Here, organization is a client's unique identifier in the Convio system.  Every client has a unique value that represents their instance of the product. If you're organization uses a custom secure URL for donations, the organization portion of the URL may not be necessary, contact support for assistance.

Example: https://demo-secure.convio.net/demo829/site/SRConsAPI.  Here you'll notice that demo-secure.convio.net is used for the domain, and demo829 is used for the organization. 

Authentication

Authenticating Convio Server API calls is a three-stage process. First, the IP address of the server invoking the API call will be checked against the list of allowed IP ranges, per the Convio Site Configuration parameters. If the API is being invoked from a server in the allowed IP range, then the login_name and login_password parameters will be used to login to the Convio site. Finally, once the login credentials have been verified, the account specified by the login credentials will be examined to ensure that it has the Contact Management “Use Convio API” permission. If all the above hold, the caller will be authenticated and the API call will proceeed. If any of the above fail, then the call will not be authenticated and an error message will be returned.

Parameters

The definition of all constituent record fields that can be retrieved is defined in an XML Schema document (crm.public.v1.xsd). However, many of those fields might not be in use for the site and some of them might not be visible to the user requesting the record. Use the listUserFields API method to list the fields that can be retrieved.

The following parameters also apply:

Name

Description

api_key Required. An arbitrary value that must be passed when invoking the Convio Client and Server APIs. The value passed by the caller must match the value in the CONVIO_API_KEY site configuration parameter, which is unique for each Convio site.
v Required. API version to invoke. Must be "1.0".

method

Required. Specifies which method to perform. To invoke this method use the value “getUser”.

response_format

Optional. Specifies the format in which to return the response. Can be either "xml" (the default value) or "json".

login_name

Required. Specifies the user name of the account to authenticate.

login_password

Required. Specifies the password of the account to authenticate.

cons_id

The internal constituent ID of the user.

member_id

The external member ID of the user.

primary_email

The email address of the user.

fields

Optional. Specifies a comma-separated list of names of fields to retrieve. If not specified, then all fields in use and visible to the caller are returned. Use "dot" notation to refer to nested elements of the XML schema. For example, use "name.first" to request the "first" element of the "name" element (the user's first name).

If the requester is not an administrator, then the requester's own record is retrieved regardless of what cons_id is specified.

If the requester is an administrator, then one of cons_id, member_id, or primary_email must be specified in order to locate the record to retrieve.

  1. If cons_id is given, then it is the only thing used to search.
  2. If cons_id is absent and member_id is given, then it is the only thing used to search.

    • If one record matches member_id, it is retrieved.
    • If multiple records match member_id, then this is an error and no record is retrieved.
    • If no records match member_id, then primary_email is searched. If exactly one match is found, then that record is retrieved.
  3. If cons_id and member_id are absent, then primary_email is searched and a record is updated if exactly one match is found.

If the requester is not an administrator, then the requester's own record is updated regardless of what cons_id is specified.

 

Response

Success

The HTTP status code is 200. The response is formatted as XML by default, but the response_format input parameter can be used to specify either XML or JSON formatting. A successful invocation might appear as follows:

XML format:

<getConsResponse 
  xsi:schemaLocation=http://convio.com/crm/v1.0
  http://service.convio.net/xmlschema/crm.public.v1.xsd
  xmlns="http://convio.com/crm/v1.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<cons_id>1001172</cons_id>
<name>
   <title xsi:nil="true"/>
   <first>Zaphod</first>
   <last>Beeblebrox</last>
</name>
<email>
   <primary_address>zaphod@convio.com</primary_address>
</email>

</getConsResponse>

 

JSON format:
{"getConsResponse":{"cons_id":"1001172",
"email":{"primary_address":zaphod@convio.com},
"name":{"last":"Beeblebrox","title":null,"first":"Zaphod"}}}

 

Notes:

  • If a field is not included in the response, it is either not enabled for the site or it is invisible to the caller.
  • If the field is included but has no value (xsi:nil="true" in an XML response or null in a JSON response), then the field is visible and has a null value for the retrieved record.
  • If a composite element (one that can contain nested elements), such as "name" or "email" in the example above, is nil then all of its contained fields are either disabled or have nil values for this record.

 

Error

If there is an error, the response contains an error code and message that may help explain the reason for the failure. For example:

XML format:

<errorResponse 
  xsi:schemaLocation=http://convio.com/crm/v1.0
  http://service.convio.net/xmlschema/crm.public.v1.xsd
  xmlns="http://convio.com/crm/v1.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<code>16</code>
<message> Cannot access the user because no records
match the search criteria.</message>

</errorResponse>

 

JSON format:
{"errorResponse":{"code":"16",
"message":"Cannot access the user because no records
match the search criteria."}}

 

See the complete list of HTTP Status codes and Error codes for calling from another application.

 

 

Client Community
Log in to chat with other clients and partners using APIs and share code snippets.

Community