We suggest the following steps:
-
Getting Started
Click here to get started browsing the Corporate WebAPI. This will present you with all the API endpoints and allow you to explore and execute each one, showing you the response in each case. -
Creating a new API session
To execute an endpoint of the API you first need to logon and create a live session. To do this you need to go to 'api/sessions/logon', provide a valid authentication object, and click "Try it out!". If the logon is successful a valid authenticated session will be created and returned within the response. You then need to copy the SessionID value, paste it into the 'api_key' field (at the top of the page) and click 'Explore'. This will subsequantly allow you to execute all the API endpoints with an authenticated session. Note; if you try to execute the endpoints without a valid session an appropriate error will be returned. -
Browsing the API and then logging out of the session
Browsing the API is simple. All you need to do is click the link of the endpoint that you wish to explore, provide the appropriate parameters as needed and then click "Try it out!". After a few seconds the response will be returned. In each case where a collection is being returned an ODATA command can be provided to filter the data (i.e. $filter=ITEMNO eq '10101001'). Also, within the same 'filter' option you can also specify a 'fields' parameter (i.e. fields=recid, recorder) so shape the payload returned.When finished you can logoff the current session using 'api/sessions/logoff/{id}' (id being the SessionID). Note; if you do not log out of the session it will automatically timeout after 30 minutes of inactivity.
-
Using paging with your GET requests
It is best practice to use paging when retrieving a collection of results from the API, this can be used within the ODATA parameter.
Paging can be created using the top ($top) and skip ($skip) ODATA functions, these work directly with the resulting recordset. To retrieve your collection with a total record count you can use the paging filter ($inlinecount=allpages) within the ODATA parameter.
-
$top=2&$skip=10&$inlinecount=allpages. Will retrieve page 6 with 2 records per page showing a total record count of 20.
{
"results": [}
{],"Username": "john.doe",},
"Password": "password",
"Depot": 100
{
"Username": "jane.doe",}
"Password": "password",
"Depot": 100
"totalCount": 20
-
$top=2&$skip=10&$inlinecount=allpages. Will retrieve page 6 with 2 records per page showing a total record count of 20.
-
HTTP Return codes
For return codes we like to keep it simple and so all return codes basically fall into the following categories:- No access allowed - Unauthorised client
- Everything worked - Success
- The application did something wrong - Client error
- The API did something wrong - Server error
- 401 - Unauthorised
- 200/201 - OK/Created
- 400/401 - Bad Request/Not Found
- 500 - Internal Server Error
-
API Objects
A number of the API endpoints (PUSH and PUT) require a valid populated Javascript object to be passed within the request body. Example objects for each of those required is shown below. For more information regarding object properties see the Data Dictionary.- Authenticate. Used when logging into the API to create a live session.
{
"Username": "john.doe",}
"Password": "password",
"Depot": 100
- Customer. Used when creating/updating an inspHire Customer record.
{
"Acct": "",}
"Acctmemo": "",
"Acctopen": "",
"Acctstatus": "",
"Addr1": "",
"Addr2": "",
"Addr3": "",
"Addr4": "",
"Addr5": "",
"Addrcontact": "",
"Address": "",
"Altglobal": 0,
"Analysis1": "",
"Analysis2": "",
"Analysis3": "",
"Balance": 0,
"Band": "",
"Bukrs": "",
"Bussector": "",
"Ciflag": 0,
"Cntcprsn": "",
"Contact": "",
"Countryid": "",
"Creditlim": 0,
"Creditref": "",
"Credlimtype": 0,
"Credsupapp": 0,
"Currency": "",
"Currid": "",
"Currorddef": 0,
"Currrateid": "",
"Custgrpcode": "",
"Damageexcess": 0,
"Damagewaver": 0,
"Defcalcode": "",
"Defcustrate": "",
"Defhdrdisc": 0,
"Definvrcode": "",
"Defitemdisc": 0,
"Defnlcc": "",
"Defnlcode": "",
"Defnldept": "",
"Defsettdays": 0,
"Defsettdisc": 0,
"Dirdebit": 0,
"Duedays": 0,
"Duemonths": 0,
"Ean": "",
"Earlytermcharge": 0,
"Edi": 0,
"Ediappliesto": 0,
"Email": "",
"Emailprintopt": 0,
"Eomcrd": 0,
"Eomdebt": 0,
"Eomflag": 0,
"Eominv": 0,
"Eucustomer": 0,
"Fax": "",
"Faxdam": 0,
"Faxnumber": "",
"Fireandtheft": 0,
"Fireandtheftperc": 0,
"Forcevat": 0,
"Glnnumber": "",
"Inactive": 0,
"Insurance": 0,
"Interfaceref": "",
"Invacct": "",
"Invcopies": 0,
"Langid": "",
"Mandt": "",
"Memo": "",
"Mobilenumber": "",
"Name": "",
"Netprices": 0,
"Noins": 0,
"Onstop": 0,
"Ordfmt": "",
"Ordnoreq": 0,
"Oscont": 0,
"Parmset": "",
"Paycode": "",
"Placct": "",
"Postacct": "",
"Postcode": "",
"Postjc": 0,
"Pricelist": "",
"Recipientemail": "",
"Recipientname": "",
"Salesarea": "",
"Salesperson": "",
"Shortname": "",
"Spcode": "",
"Telephone": "",
"Terms": "",
"Vatcode": 0,
"Vatregidno": "",
"Vatregno": "",
"Vatregnocountryid": "",
"Wherefrom": 0 - Stock. Used when creating/updating an inspHire Stock record.
{
"Accnlcc": "",}
"Accnlcode": "",
"Accnldept": "",
"Accode": "",
"Acflag": "",
"Active": 0,
"Alloctransrev": 0,
"Allowrw": 0,
"Altchrg": 0,
"Altitemno": "",
"Anlcode": "",
"Avcost": 0,
"Barcode": "",
"Budget1": 0,
"Budget10": 0,
"Budget11": 0,
"Budget12": 0,
"Budget2": 0,
"Budget3": 0,
"Budget4": 0,
"Budget5": 0,
"Budget6": 0,
"Budget7": 0,
"Budget8": 0,
"Budget9": 0,
"Buyprice": 0,
"Calcode": "",
"Calper": 0,
"Capacity": 0,
"Captype": 0,
"Cemark": 0,
"Chargehandling": 0,
"Cntorigin": "",
"Comcode": "",
"Conditioncost": 0,
"Conditionhours": 0,
"Constock": 0,
"Cosnlcc": "",
"Cosnlcode": "",
"Cosnldept": "",
"Currdepot": "",
"Custom": 0,
"Customer": "",
"Damagewaver": 0,
"Datepurch": "1899-12-30 00:00:00",
"Datesold": "1899-12-30 00:00:00",
"Dateused": "1899-12-30 00:00:00",
"Daysunav": 0,
"Defcostgrp": "",
"Defdep": "",
"Defrate": "",
"Deposit": 0,
"Depotorigtype": 0,
"Depotplcode": "",
"Depotposted": 0,
"Depotslcode": "",
"Deprmeth": 0,
"Depth": 0,
"Desc1": "",
"Desc2": "",
"Desc3": "",
"Dlycost": 0,
"Driver": "",
"Ean": 0,
"Earlytermcharge": 0,
"Extmemo": "",
"Extxh": 0,
"Fireandtheft": 0,
"Fwdorder": 0,
"Grossprice": 0,
"Grpactive": 0,
"Grpcode": "",
"Handlingperc": 0,
"Height": 0,
"Hidewp": 0,
"Hpnlcc": "",
"Hpnlcode": "",
"Hpnldept": "",
"Insvalue": 0,
"Invoho": 0,
"Itemno": "",
"Jccode": "",
"Jccodexh": "",
"Jirecid": "",
"Joinaccess": 0,
"Kitflag": 0,
"Labitem": 0,
"Lasthire": "1899-12-30 00:00:00",
"Lastser1": "1899-12-30 00:00:00",
"Lastser2": "1899-12-30 00:00:00",
"Lastser3": "1899-12-30 00:00:00",
"Lastser4": "1899-12-30 00:00:00",
"Lastser5": "1899-12-30 00:00:00",
"Lastser6": "1899-12-30 00:00:00",
"Lifecosts": 0,
"Lifedepr": 0,
"Liferev": 0,
"Lmtdrev": 0,
"Location": "",
"Lytdrev": 0,
"Manuf": 0,
"Mastrec": 0,
"Maxstk": 0,
"Memtype": 0,
"Meter": 0,
"Metered": 0,
"Metertotal": 0,
"Minstk": 0,
"Mstcode": "",
"Mtdcosts": 0,
"Mtdrev": 0,
"Nlcc": "",
"Nlcode": "",
"Nldept": "",
"Nodisc": 0,
"Nofar": 0,
"Nonstock": 0,
"Noresale": 0,
"Nosusp": 0,
"Notes": "",
"Ohstatus": 0,
"Onorder": 0,
"Pack": 0,
"Packpurc": 0,
"Packsell": 0,
"Paload": 0,
"Paloadun": "",
"Patlastperiod": 0,
"Patlastser": "1899-12-30 00:00:00",
"Patperiod": 0,
"Patperiodtype": 0,
"Pattest": 0,
"Period1": 0,
"Period2": 0,
"Period3": 0,
"Period4": 0,
"Period5": 0,
"Period6": 0,
"Perlast1": 0,
"Perlast2": 0,
"Perlast3": 0,
"Perlast4": 0,
"Perlast5": 0,
"Perlast6": 0,
"Pertype1": 0,
"Pertype2": 0,
"Pertype3": 0,
"Pertype4": 0,
"Pertype5": 0,
"Pertype6": 0,
"Pgroup": "",
"Pirecid": "",
"Price": 0,
"Prl": 0,
"Prltype": 0,
"Purinv": "",
"Purord": "",
"Qtyalloc": 0,
"Qtyhire": 0,
"Qtyit": 0,
"Qtyitj": 0,
"Qtyitja": 0,
"Qtyrep": 0,
"Qtyser": 0,
"Qtytbom": 0,
"Qtytemp": 0,
"Qtywip": 0,
"Readdate": "1899-12-30 00:00:00",
"Reorder": 0,
"Sdept": "",
"Sdesc1": "",
"Sdesc2": "",
"Sdesc3": "",
"Serno": "",
"Showtb": 0,
"Sirecid": "",
"Snlcc": "",
"Snlcode": "",
"Snldept": "",
"Sold": 0,
"Soldby": 0,
"Spnlcc": "",
"Spnlcode": "",
"Spnldept": "",
"Ssparrecid": "",
"Startfinyearwdv": 0,
"Status": 0,
"Stdcost": 0,
"Sterdept": "",
"Stklevel": 0,
"Supersededfrom": "",
"Suppdesc": "",
"Supplier": "",
"Suppref": "",
"Swl": 0,
"Swload": 0,
"Swloadun": "",
"Swltype": 0,
"Tcdate": "1899-12-30 00:00:00",
"Tcno": "",
"Temphire": 0,
"Test1": "",
"Test10": "",
"Test11": "",
"Test12": "",
"Test13": "",
"Test14": "",
"Test15": "",
"Test2": "",
"Test3": "",
"Test4": "",
"Test5": "",
"Test6": "",
"Test7": "",
"Test8": "",
"Test9": "",
"Tothire": 0,
"Tothours": 0,
"Trueunqty": 0,
"Type": 0,
"Unique": 0,
"Usagedays": 0,
"Usedfor": "",
"Usedprice": 0,
"Usetempl1": 0,
"Usetempl2": 0,
"Usetempl3": 0,
"Usetempl4": 0,
"Usetempl5": 0,
"Usetempl6": 0,
"Usetempl7": 0,
"Utype": 0,
"Vatcode": 0,
"Vatcodepl": 0,
"Vehrental": 0,
"Weight": 0,
"Weighting": 0,
"Width": 0,
"Wipnlcc": "",
"Wipnlcode": "",
"Wipnldept": "",
"Xhirealloc": 0,
"Xhirelevel": 0,
"Xhnlcc": "",
"Xhnlcode": "",
"Xhnldept": "",
"Xrnlcc": "",
"Xrnlcode": "",
"Xrnldept": "",
"Ytdcosts": 0,
"Ytddepr": 0,
"Ytdrev": 0 - Stock Depot. Used when creating/updating an inpHire Stock Depot record.
{
"Active": 0,}
"Bin": "",
"Budget1": 0,
"Budget10": 0,
"Budget11": 0,
"Budget12": 0,
"Budget2": 0,
"Budget3": 0,
"Budget4": 0,
"Budget5": 0,
"Budget6": 0,
"Budget7": 0,
"Budget8": 0,
"Budget9": 0,
"Code": "",
"Constock": 0,
"Cost": 0,
"Fwdorder": 0,
"Grpcode": "",
"Itemno": "",
"Itemtype": 0,
"Location": "",
"Lstocktake": "1899-12-30 00:00:00",
"Maxstk": 0,
"Minstk": 0,
"Onhire": 0,
"Onorder": 0,
"Qtyalloc": 0,
"Qtyit": 0,
"Qtyitj": 0,
"Qtyitja": 0,
"Qtyrep": 0,
"Qtyser": 0,
"Qtytbom": 0,
"Qtytemp": 0,
"Qtywip": 0,
"Reorder": 0,
"Stklevel": 0,
"Uniqueflag": 0,
"Xhirealloc": 0,
"Xhirelevel": 0 - Depot. Used when creating/updating an inpHire Depot record.
{
"Acctno": "",}
"Addr1": "",
"Addr2": "",
"Addr3": "",
"Addr4": "",
"Cntcode": "",
"Code": "",
"Contact": "",
"Datapath": "",
"Dtcode": "",
"Email": "",
"Extnumber": "",
"Faxno": "",
"Forcetaxarea": 0,
"Geocode": 0,
"L50dept": 0,
"Master": 0,
"Masterdepot": "",
"Mdagrphire": "",
"Mdagrpsale": "",
"Mgacode": "",
"Name": "",
"Nlcc": "",
"Parmset": "",
"Pickday": 0,
"Placct": "",
"Postcode": "",
"Regcode": "",
"Satellite": 0,
"Stdfinish": "",
"Stdstart": "",
"Stdstraight": 0,
"Subcon": 0,
"Taxareacode": 0,
"Taxareacodepl": 0,
"Telno1": "",
"Telno2": "",
"Telno3": "",
"Wonlcc": "",
"Wonlcode": "",
"Wonldept": "" - NL Lookup. Used when creating/updating an inpHire NLLookup record.
{
"Altglobal": 0,}
"Bukrs": "",
"Cc": "",
"Code": "",
"Dept": "",
"Interfaceref": "",
"Mandt": "",
"Name": "",
"Parmset": "" - Payment Term. Used when creating/updating an inpHire Payment Term record.
{
"Code": "",}
"Days1": 0,
"Days2": 0,
"Name": "",
"Settapply": "",
"Settdays": 0,
"Settdisc": 0,
"Wherefrm1": 0,
"Wherefrm2": 0 - Delivery Method. Used when creating/updating an inpHire Delivery Method record.
{
"Areamandatory": 0,}
"Capacity": 0,
"Charge": 0,
"Code": "",
"Cost": 0,
"Depot": "",
"Depotcc": "",
"Driver": "",
"Flag1": 0,
"Flag10": 0,
"Flag2": 0,
"Flag3": 0,
"Flag4": 0,
"Flag5": 0,
"Flag6": 0,
"Flag7": 0,
"Flag8": 0,
"Flag9": 0,
"Inactive": 0,
"Iprice": 0,
"Iqty": 0,
"Itemno": "",
"Memo": "",
"Micc": "",
"Midept": "",
"Name": "",
"Nlcc": "",
"Nlcode": "",
"Nldept": "",
"Pdacode": "",
"Placct": "",
"Pocc": "",
"Podept": "",
"Regno": "",
"Tprice": 0,
"Tranmode": "",
"Trannat": "",
"Vatcode": 0,
"Vatcodepl": 0,
"Vehmake": "",
"Vehmodel": "" - Profiles. Used when creating/updating an inpHire Profile record.
{
"Type": 0,}
"Id": 0,
"Fields": [
{]
"Key": "",}
"Value": ""
- EBusiness Order. Used when creating, updating or deleting EBusiness Order records.
{
"Acct": "",}
"Acctname": "",
"Deladdr": "",
"Delcont": "",
"Deldate": "1899-12-30 00:00:00",
"Delemail": "",
"Delmeth": "",
"Delname": "",
"Delpcode": "",
"Deltel": "",
"Estretd": "1899-12-30 00:00:00",
"Hiredate": "1899-12-30 00:00:00",
"Memo": "",
"Ordby": "",
"Reference": "",
"Refno": 0,
"Spcode": "",
"Type": "",
"Items": [
  {
    "Descr": "",
    "Itemno": "",
    "Memo": "",
    "Price": 0,
    "Qty": 0,
    "Type": 0,
  },
  {
    "Descr": "",
    "Itemno": "",
    "Memo": "",
    "Price": 0,
    "Qty": 0,
    "Type": 0,
    "Accessories": [
      {
        "Descr": "",
        "Itemno": "",
        "Memo": "",
        "Price": 0,
        "Qty": 0,
        "Type": 0,
      },
      {
        "Descr": "",
        "Itemno": "",
        "Memo": "",
        "Price": 0,
        "Qty": 0,
        "Type": 0,
      }
    ]
  }
] - EBusiness Item. Used when creating, updating or deleting EBusiness Order Item records.
{
"Descr": "",}
"Itemno": "",
"Memo": "",
"Paritem": "",
"Price": 0,
"Qty": 0,
"Refno": 0,
"Type": 0,
- Authenticate. Used when logging into the API to create a live session.