Limitations
4 min
max 60 api calls per minute max 1,000 api calls per hour max 10 gb traffic per month max 500 records per api call max 4,000 characters in the filter of an api call fair use policy to ensure that server performance is not affected by overuse of individual users, access to the api for such users can be restricted prohibited the api may not be used for any illegal, unethical, or malicious activity including but not limited to hacking, spamming or spreading malware liability the api owner is not responsible for any damage or loss resulting from the use of the api users assume full responsibility for their use of the api and any consequences thereof these guidelines and limitations may be updated at any time it is the user's responsibility to stay informed of changes remarks regarding the limits programmatically always try to work per bulk request, i e programmatically collect/aggregate the data sets and generate a full api query instead of per determined data set (saves calls and is more performant) with saveall the dataid and entityid of the created record can be delivered as 200 http code including returntext these can be written back (for orders, any master data, etc ) in order to make direct calls/matches accordingly consider the documentation! listing of all entities and their properties can be queried via "getgenericentities" and "getgenericproperties" your consultant can explain the relationships between the entities loops with included api calls (general multiple calls) should be avoided the api user may not have rights for most entities your consultant needs to know what kind of entities you want to manage via the api so that the correct rights/roles can be set up! example this example creates an api token, retrieves a record, and writes a record including lookupproperty to a table common (pyhthon) import requests import sys \## uris (more uris https //test engine4 io/externalapidocs/) endpoint = "https //test engine4 io" endpoint token = endpoint + "/token" endpoint get = endpoint + "/webapi/external/get" endpoint fetch = endpoint + "/webapi/external/fetch" endpoint saveall = endpoint + "/webapi/external/saveall" \## auth settings auth clientid = "xxx" auth user = "xxx\@mobile function com" auth pass = "xxx" \######## /token request head = {"content type" "application/x www form urlencoded"} body = {"client id" auth clientid, "grant type" "password", "username" auth user , "password" auth pass} \# every request is put in a try except block to handle connection issues try response = requests post(endpoint token, headers=head, data=body) except requests requestexception as e sys exit("error {0}" format(e)) \# every request is expected to be successfull (200), handling errors on others response code = response status code if (response code==200) try data = response json() except requests jsondecodeerror as e sys exit("error {0}" format(e)) else sys exit("errorcode " + str(response code) + " errormessage " + response text) \# retrieve auth data access token = data\['access token'] expires in = data\['expires in'] token type = data\['token type'] refresh token = data\['refresh token'] scope = data\['scope'] \# generate auth token for further requests auth token = token type + " " + access token \############################################################################## \#### example (get) get an object from an entity with a already known dataid entityid = "xxx" dataid = "xxx" head = {"authorization" auth token} body = {"entityid" entityid, "dataid" dataid} try response = requests get(endpoint get, headers=head, data=body) except requests requestexception as e sys exit("error {0}" format(e)) response code = response status code if (response code==200) try data = response json() except requests jsondecodeerror as e sys exit("error {0}" format(e)) else sys exit("errorcode " + str(response code) + " errormessage " + response text) \#print(data) \############################################################################## \#### example (post) save a new item including referenced field \## get a referenced object first entityid = "xxx" head = {"authorization" auth token, "content type" "application/json"} body = {"entityid"\ entityid,"take" 1,"skip" 0,"filter" {"genericname" "custom 001","compareoperator" "contains","value" "xxx"},"isactive" 1,"sortings" \[]} try response = requests post(endpoint fetch, headers=head, json=body) except requests requestexception as e sys exit("error {0}" format(e)) response code = response status code if (response code==200) try data = response json() except requests jsondecodeerror as e sys exit("error {0}" format(e)) else sys exit("errorcode " + str(response code) + " errormessage " + response text) \#print(data) try data = response json() except requests jsondecodeerror as e sys exit("error {0}" format(e)) referencedobject = data\[0]\['dataid'] \## create new entry with referenced object and main object entityid = "xxx" head = {"authorization" auth token, "content type" "application/json"} body = {"items" \[{"entityid" entityid,"custom 001" "api test #1", "custom 004" referencedobject}], "returntype" "dataid"} try response = requests post(endpoint saveall, headers=head, json=body) except requests requestexception as e sys exit("error {0}" format(e)) response code = response status code if (response code==200) try data = response json() except requests jsondecodeerror as e sys exit("error {0}" format(e)) else sys exit("errorcode " + str(response code) + " errormessage " + response text) \#print(data) \## this is the end quit() powerbi (python) # check this microsoft documention https //learn microsoft com/de de/power bi/connect data/desktop python scripts import sys import requests import pandas as pd endpoint = "https //test engine4 io" endpoint token = endpoint + "/token" endpoint fetchnamed = endpoint + "/webapi/external/fetchnamed" auth clientid = "xxx" # additional factor auth user = "xxx\@mobile function com" auth pass = "xxx" \################################## authenticate ############################################ head = {"content type" "application/x www form urlencoded"} body = {"client id" auth clientid, "grant type" "password", "username" auth user , "password" auth pass} \# every request is put in a try except block to handle connection issues try response = requests post(endpoint token, headers=head, data=body) except requests requestexception as e sys exit("error {0}" format(e)) \# every request expect to be successfull (200), handling errors on others response code = response status code if (response code==200) \# every json parsing part is try/excepted try data = response json() except requests jsondecodeerror as e sys exit("error {0}" format(e)) else sys exit("errorcode " + str(response code) + " errormessage " + response text) \# retrieve auth data access token = data\['access token'] expires in = data\['expires in'] token type = data\['token type'] refresh token = data\['refresh token'] scope = data\['scope'] \# generate auth token for further requests auth token = token type + " " + access token \################################## get entity 1 ############################################ head = {"authorization" auth token, "content type" "application/json"} body = {"identifier" "xxx","take" 100,"skip" 0,"isactive" 1,"sortings" \[]} \# every request is put in a try except block to handle connection issues try response = requests post(endpoint fetchnamed, headers=head, json=body) except requests requestexception as e sys exit("error {0}" format(e)) \# every request expect to be successfull (200), handling errors on others response code = response status code if (response code==200) try data = response json() except requests jsondecodeerror as e sys exit("error {0}" format(e)) else sys exit("errorcode " + str(response code) + " errormessage " + response text) \# we need to know the column names which we're getting from the rest api these has to be in the dataframe command only flat tables allowed! \# the name of the variable will be the table name in powerbi \# columnname1 and 2 will be the name of the columns in powerbi tablename1 = pd dataframe(data,columns=\['columnname1','columnname2'],dtype=object) print(tablename1) \################################## entity 2 ############################################ head = {"authorization" auth token, "content type" "application/json"} body = {"identifier" "xxx","take" 100,"skip" 0,"isactive" 1,"sortings" \[]} try response = requests post(endpoint fetchnamed, headers=head, json=body) except requests requestexception as e sys exit("error {0}" format(e)) response code = response status code if (response code==200) try data = response json() except requests jsondecodeerror as e sys exit("error {0}" format(e)) else sys exit("errorcode " + str(response code) + " errormessage " + response text) tablename2 = pd dataframe(data,columns=\['columnname1'],dtype=object) print(tablename2) \################################## end ############################################ quit()