API - Developer Platform

 

Create a powerful application with Turkishexportal.

The API provides the site members with the ability to access and manipulate the desired data from the platform. The API functions provide an infrastructure that can be easily implemented between any application or website and Turkishexportal . Many of the actions that members perform on the site, such as company update, add / modify / delete products, add / change / delete news and references, read / reply / delete messages, visitor reports are also available to users via API . API accepts requests in the form REST and accepts multiple respond type (XML, JSON).

Some information about using the API ;

  • Each request should have a correct and valid API Access code .
  • All methods can be sent with different parameters under a single URL, https://wwww.turkishexportal.com/api/1.0/ (1.0 version information and will change over time.)
  • If the read requests are GET, write requests (add, modify, delete) then POST must use.
  • All requests must contain the method parameter. A sample request, below as shown:

    https://www.turkishexportal.com/api/1.0/company/update

For any issues with API , you can contact us at info@turkishexportal.com .

Basic Concepts

The Basics Concepts page's API requirements are important to include error codes, general information, etc. We recommend starting with this section for the API . In the next stage, you can see the here methods you can use on the API . Finally, you should get a access code to integrate your API into your application.

Requests

  • You can get responses in the format you specify for Response Titles and API requests.
  • All reading [GET] and writing requests [POST] should have a valid access code .
  • The method parameter in the request must be one of those listed in methods .
  • Updating will only update [ update ] information for valid parameters that have been sent, other information will be preserved.
  • For all numeric parameters that must be sent with decimal point, dot [.] will be used as the decimal separator. Example: 1345.72
  • The date information should be in the format dd / mm / yyyy in the parameters to be sent. Example: 17/09/2005
  • Logical expressions are specified with the boolean statement, where 1 or 0 should be assigned.
  • You can set the language to work with the language parameter.

Responses

  • Replies are encoded in UTF-8 format.
  • In all responses timestamp information [yyyyMMddHHmmss] is sent. For example: 20091211153544
  • Review the Errors section for error codes and clarifications.

Paging

This allows the data to be sent in handleable sizes for requests that list count , page and current parameters. Things to consider in lists;

  • The number of record impressions per page in the replies given is the same as the number defined for your company membership.
  • The number of records in the response is count , the number of pages is page , and the active page number is sent in current
  • The data for the first page will be returned as long as the page value is not sent in the submitted requests.
  • There must be a value between the page parameter 1 and page . This will result in page requests that are not in this range.

Answer Types

Turkishexportal API can send responses in 2 different formats;

  • XML : Many programming languages are easily adaptable by language and platform.
  • JSON : Another type of response that is accepted by the eval function in Javascript, or by many programming languages.

How to Determine the Response Type

The type of response to be received is provided by the format parameter in the submitted request. When this parameter is not sent, the response is returned as standard JSON type. If you want to change it, you can specify the response type for each request by adding the format = xml or format = json parameter.

XML

XML responses are in a special XML format specified by Turkishexportal.

https://www.turkishexportal.com/api/1.0/company/select?key=123&type=xml

Sample request - Truncated

<?xml version="1.0"?>
<Company xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <accountype>F</accountype>
  <active>Y</active>
  <alias>test</alias>
  <businesstype>01</businesstype>
  <communication>
    <address1>Ahmet Sokak. Aykon Apt.</address1>
	.
	.
	.
</Company>

JSON

JSON ( JavaScript Object Notation , json.org ) is a simple and useful data declaration format. It is used extensively in Ajax applications, especially those used within the browser.

https://www.turkishexportal.com/api/1.0/company/select?key=123&type=json

Sample request - Truncated

{
    "accountype":"F",
    "active":"Y",
    "alias":"test",
    "businesstype":"01",
    "communication":{  
        "address1":"Ahmet Sokak. Aykon Apt.",    
    .
    .
    }
}

Parameters

The parameters in this page are also used from time to time in definitions in the portal.

代码 声明
TL 04 助理出口及销售经理
05 助理出口部经理
06 总经理助理
10 助理销售经理
100
101 总经理
103 国际市场助理
104 国际营销经理
109 国际销售经理
116 经理
118 常务董事
123 营销与销售代表
128 市场经理
129 销售代表
13 业务发展经理
139 所有者
14 业务发展专家
143 伙伴
160 代表
161 销售及出口总监
162 销售和出口部经理
164 销售经理
17 CEO
170 销售经理
171 销售代表
35 导向器
36 业务发展总监
37 导演出口和进口
38 销售及物流总监
46 出口和进口助手
48 出口和进口部经理
49 出口和进口代表
62 出口部主任
65 出口部经理
69 出口代表
72 出口销售代表
82 国外销售经理
83 国外销售代表
92 外贸经理
95 外贸代表
98 创始人/经理
99
代码 声明
ER 01 42644
02 10 - 50
03 50 - 100
04 100 - 250
05 > 250

Access Code

All access should be sent in the all requests apikey field via the Turkishexport API . Please keep your access code in a safe place. Keep in mind that your data security will be compromised if you have the code provided within your membership. In such cases, you must ensure that your code is canceled by contacting info@turkishexportal.com via email. A sample request with API Access Code is shown below.

https://www.turkishexportal.com/api/1.0/company/select?format=xml&apikey=f893a3bf3cfc432a8e304f07e5ea11f5

The apikey used in the above example is not a valid access code. It is given only in terms of being an example. Please use the apikey API Access Code assigned specifically to you in your own application.

Method List

Company

Update
Field 声明 类型
name 公司名称 Varchar [100]
<?xml version="1.0"?>
<Company xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <uid>33d27f2c6ed0403f98ab0219e3fec20e</uid>
  <name>Test Co Ltd.</name>
  <history>Test is the company that provides the best product.</history>
  <email>info@test.com</email>
  <mf>M</mf>
  <representative>Test Person</representative>
  <establishdate>1965</establishdate>
  <businesstype>01</businesstype>
  <statistic>
    <itemscount>4</itemscount>
    <newscount>1</newscount>
    <referencecount>1</referencecount>
    <certificatecount>2</certificatecount>
  </statistic>
</Company>

Error List

代码 声明
100 没有找到记录
110 Please check invalid fields.
255 发生错误。

Code Execution

 

返回首页