1. General information
Home / API Calls Reference > 1. General information

Content



Authentication
Call identification
Authentication of the interface user
Authentication of the Afterbuy account
Global parameters
Calling the interface
Testing the interface
Transmission status


»

Authentication



For authentication, the partner token and the Afterbuy account token are required.

»

Call identification



CallName - Name of the call (e.g. GetAfterbuyTime)

»

Authentication of the interface user



PartnerToken – The partner token which is provided by Afterbuy

»

Authentication of the Afterbuy account



AccountToken –  The account token which is provided by Afterbuy

»

Global parameters



DetailLevel – Controls the amount of data that is retrieved.
The values for DetailLevel can be specified so that only the required data is returned.
Using DetailLevel reduces traffic and increases transmission speed.

The DetailLevel can be defined by adding DetailLevel numbers together, e.g. 2 + 8 + 16 = 26.

ErrorLanguage – Sets the language in which the errors or warnings are returned.

All requests must be 'UTF-8' encoded.

The global parameters are optional. However, DetailLevel must be set for most calls in order to retrieve any data. Each call has a default DetailLevel. If 'ErrorLanguage' is not passed, all errors/warnings are returned in German.

The XML tag 'AfterbuyGlobal' must be present every time the interface is called.

Code:
<AfterbuyGlobal>
        <PartnerToken>123456789</PartnerToken>
        <AccountToken>987654321</AccountToken>
         <CallName>GetAfterbuyTime</CallName>
        <DetailLevel>0</DetailLevel>      
</AfterbuyGlobal>


»

Calling the interface



The interface is accessed via an HTTPS post (SSL encryption).
URL: https://api.afterbuy.de/afterbuy/ABInterface.aspx  

»

Testing the interface



Any tool such as Postman can be used to test the interface.
Simply send an HTTP post to the corresponding API url.

ContentType: application/xml

»

Transmission status

(Success / Error / Warnings)

Each time the interface is called, a response is given by Afterbuy. The response of the successful request contains the requested data or a success message if no data has to be returned. Empty text and date fields are not returned. If there are errors in the request, a list of errors will be returned. If the query was successful but some non-serious problems occurred during execution, warnings are sent with the response.

Success message (CallStatus = ’Success’):

Code:
<Afterbuy>
    <CallStatus>Success</CallStatus>
    <CallName>GetAfterbuyTime</CallName>
    <Result>
      <AfterbuyTimeStamp>07.05.2006 12:06:19</AfterbuyTimeStamp>
      <AfterbuyUniversalTimeStamp>07.05.2006 10:06:19</AfterbuyUniversalTimeStamp>
    </Result>
</Afterbuy>


Success message with warnings (CallStatus = ’Warning’):

Code:
<Afterbuy>
    <CallStatus>Warning</CallStatus>
    <CallName>GetAfterbuyTime</CallName>
    <Result>
      <AfterbuyTimeStamp>07.05.2006 12:08:03</AfterbuyTimeStamp>
      <AfterbuyUniversalTimeStamp>07.05.2006 10:08:03</AfterbuyUniversalTimeStamp>
      <WarningList>
        <Warning>
          <WarningCode>1</WarningCode>
          <WarningDescription>There is an unknown error unexpectedly ...</WarningDescription>
          <WarningLongDescription>An unknown error has occurred unexpectedly.</WarningLongDescription>
        </Warning>
      </WarningList>
    </Result>
</Afterbuy>


Error (CallStatus = ’Error’):

Code:
<Afterbuy>
    <CallStatus>Error</CallStatus>
    <CallName>GetAfterbuyTime</CallName>
    <Result>
      <ErrorList>
        <Error>
          <ErrorCode>14</ErrorCode>
          <ErrorDescription> This action is currently...</ErrorDescription>
          <ErrorLongDescription> This action is currently not available. Please try again later.</ErrorLongDescription>
        </Error>
      </ErrorList>
    </Result>
</Afterbuy>


Each warning and error has a unique identifier that is always returned in the <ErrorCode> and <WarningCode> tags. Additional tags can also be included if needed.
© Copyright 2003 - 2023 ViA-Online GmbH – All rights reserved | www.afterbuy.de