Every ChannelAdvisor account has a Profile ID, which is an eight-digit integer. Profile ID can be found in the account list at the top of the Account Authorizations page in the ChannelAdvisor UI. A UI user must have Client Admin permissions to be able to access the Account Authorizations page. To request API access to an account using the RequestAccess API method, you must submit the Profile ID of the account in the localID parameter of the RequestAccess request. Once your authorization has been enabled by a UI user on the Account Authorizations page, you will be allowed to interact with the account through the use of API methods, and you will be able to retrieve the AccountID, which is a GUID, using the GetAuthorizationList API method. Whether you use your own code or a tool like soapUI or Wizdler, you must use the API in order to set up API access to ChannelAdvisor accounts.
Let's pretend I own a ChannelAdvisor account and have hired you to create and API integration for me. First, I go to the Account Authorizations page in the UI and locate my Profile ID. Let's say my Profile ID is 99999999. After I tell you my Profile ID, you call RequestAccess using a request similar to the following:
<soapenv:Header>
<web:APICredentials>
<web:DeveloperKey>...</web:DeveloperKey>
<web:Password>...</web:Password>
</web:APICredentials>
</soapenv:Header>
<soapenv:Body>
<web:RequestAccess>
<web:localID>99999999</web:localID>
</web:RequestAccess>
</soapenv:Body>
</soapenv:Envelope>
The response will look like this:
<soap:Envelope xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="
http://www.w3.org/2001/XMLSchema">
<soap:Body>
<RequestAccessResponse xmlns="
http://api.channeladvisor.com/webservices/">
<RequestAccessResult>
<Status>Success</Status>
<MessageCode>0</MessageCode>
<ResultData>true</ResultData>
</RequestAccessResult>
</RequestAccessResponse>
</soap:Body>
</soap:Envelope>
After you call RequestAccess, I see an alert in the UI notifying me about your pending authorization. I go to the Account Authorizations page and enable your authorization, after which you receive an email from
developeradmin at channeladvisor dot com notifying you that your authorization has been enabled. Finally, you call GetAuthorizationList to retrieve my AccountID using a request similar to the following:
<soapenv:Header>
<web:APICredentials>
<web:DeveloperKey>...</web:DeveloperKey>
<web:Password>...</web:Password>
</web:APICredentials>
</soapenv:Header>
<soapenv:Body>
<web:GetAuthorizationList />
</soapenv:Body>
</soapenv:Envelope>
The response will look similar to this:
<soap:Envelope xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="
http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetAuthorizationListResponse xmlns="
http://api.channeladvisor.com/webservices/">
<GetAuthorizationListResult>
<Status>Success</Status>
<MessageCode>0</MessageCode>
<ResultData>
<AuthorizationResponse>
<AccountID>7d9fd700-7c8c-41e5-9276-9c62528ab271</AccountID>
<LocalID>99999999</LocalID>
<AccountName>Marshall's Account</AccountName>
<AccountType>merchant</AccountType>
<ResourceName>/channeladvisorapi</ResourceName>
<Status>Enabled</Status>
</AuthorizationResponse>
</ResultData>
</GetAuthorizationListResult>
</GetAuthorizationListResponse>
</soap:Body>
</soap:Envelope>
If you are authorized to access multiple accounts, there will be multiple AuthorizationResponses in the ResultData array.