An API session is a temporary unique identifier tied to a company ID, user ID, possibly an entity (via location ID), and an endpoint URL. It’s used as an alternative authentication method to avoid effectively logging in with company credentials for each API call.

Once you have a session ID, you can initiate a new entity-level session by issuing a call to get a new session and supplying the location ID of the entity you want. You should not mix getAPISession with other functions in one request.

You cannot currently go from an entity back up to the top level.


Get API Session

Release Changes
2018 Release 4 Added locationid

You should not mix getAPISession with other functions in one request.

getAPISession

Gets an API session for a company:

<getAPISession/>

Gets an API session for the given entity:

<getAPISession>
    <locationid>California</locationid>
</getAPISession>

Parameters

Name Required Type Description
locationid Optional string Location ID for an entity. From a top-level session, you can provide the location ID of an entity. From an entity level session, you can provide the location ID of a different entity. You cannot currently go from an entity back up to the top level. (Default: top level for a multi-entity company or only level for non multi-entity)

Response

The above function returns data structured like this. The location ID is empty when at the top level of a company:

<api>
    <sessionid>nOTaReAlSesSIonId..</sessionid>
    <endpoint>https://na12.intacct.com/ia/xml/xmlgw.phtml</endpoint>
    <locationid></locationid>
</api>

Parameters

api

Name Type Description
sessionid string Unique identifier for an API session
endpoint string Endpoint URL the sessionid is tied to. Use this and the sessionid for subsequent API requests
locationid string Location ID for an entity or empty if at the top level/only level of a company

Provide feedback