Account Read

Description

This call allows you to Read an account in the OGF system. The GET request version only allows you to get an account by Id where the POST version will allow you to send the username and password as a means of getting the account.

Version

2011-02-02

URI

REST URI [GET]:
/v11.02/Account.svc/Read/{AccountId}?SessionId={SessionId}

REST URI [POST]:
/v11.02/Account.svc/Read?SessionId={SessionId}

Content-Type: Application/xml

Example

Request GET
http://wsdev.onegreatfamily.com/v11.02/Account.svc/Read?AccountId=12345&SessionId=gl4q23cwofpshi55sg1dvc3o
Request POST
http://wsdev.onegreatfamily.com/v11.02/Account.svc/Read?SessionId=gl4q23cwofpshi55sg1dvc3o
Request Headers
Content-Type: Application/xml
Request Payload [POST]
<Account xmlns="http://schemas.datacontract.org/2004/07/OGF.WS.Data">
	<UserName>username</UserName>
	<Password>password</Password>
</Account>
Success Response Payload
<ReadAccountResult xmlns="http://schemas.datacontract.org/2004/07/OGF.WS.Data">
	<Account>
		<AccountId>0</AccountId> 
		<FirstName>Joe</FirstName>
		<LastName>Cardmember</LastName>
		<EmailAddress>joe@myemail.com</EmailAddress>
		<PhoneNumber>123-456-7890</PhoneNumber>
		<UserName>username</UserName>
		<Password>password</Password>
		<Address>
			<address1>1234 Market St.</address1>
			<address2></address2>
			<City>San Fransisco</City>
			<StateProvince>CA</StateProvince>
			<Country>USA</Country>
			<PostalCode>12345</PostalCode>
		</Address>
		<CreditCard>
			<NameOnCard>Joe Cardmember</NameOnCard>
			<CardNumber>1234123412341234</CardNumber>
			<CardExpiration>05.2010</CardExpiration>
			<CVV2>123</CVV2>
			<BillingAddress>
				<address1>1234 Market St.</address1>
				<address2></address2>
				<City>San Fransisco</City>
				<StateProvince>CA</StateProvince>
				<Country>USA</Country>
				<PostalCode>12345</PostalCode>
			</BillingAddress>
		</CreditCard>
		<ProductId>PRODUCT_ID</ProductId>
	</Account>
	<ErrorCode>0</ErrorCode>
	<Message></Message>
	<Status>SUCCESS</Status>
</ReadAccountResult>
Failed Response Payload
<ReadAccountResult xmlns="http://schemas.datacontract.org/2004/07/OGF.WS.Data">
	<ErrorCode>19407</ErrorCode>
	<Message>Account not found.</Message>
	<Status>ERROR</Status>
</ReadAccountResult>
Fault Response Payload
<RestFault xmlns="http://schemas.datacontract.org/2004/07/OGF.WS.Data">
	<ErrorCode>551</ErrorCode>
	<FaultMessage>An unhandled exception has occurred</FaultMessage>
</RestFault>

Query String Parameter [GET]

Name Description Required

accountId

The account identifier

Type: string

Default: None

Constraints: Must be a valid account identifier. Must be less than 20 characters.

Yes

SessionId

The current session Id

Type: string

Default: None

Yes

Query String Parameters [POST]

Name Description Required

SessionId

The current session Id

Type: string

Default: None

Yes

POST Payload

Name Description Required

Account

The account aggregate to create

Type: Account

Default: None

Constraints: Must be a valid account aggregate.

Yes

Response Elements

Name Description

 ReadAccountResult

This operation returns a ReadAccountResult aggregate.

Type: ReadAccountResult

HTTP Status Code

The Web Server returns a status code which indicates if the operation was successful. Anything other than 200 should be regarded as a failure.

HTTP Status Code of 417

The Web Server threw an exception and contains a RestFault aggregate. Retrieve the RestFault from the Webexception response property.