API Docs
Api Reference
Api reference url is dynamic for expecting data (brands, models.. etc.).
http://api.remaps.com.tr/v1/brands
http://api.remaps.com.tr/v1/models
http://api.remaps.com.tr/v1/years
http://api.remaps.com.tr/v1/engines
http://api.remaps.com.tr/v1/stages
Also you can use single url reference for every type of requests by including request type to post data as request
.
http://api.remaps.com.tr/v1
Authentication
Every request must have authentication data in header as HTTP_USER
or post data as user
. Authentication data has username and md5 crypted password seperated by :
like myusername:md5(mypassword)
.
curl -X POST \
http://api.remaps.com.tr/v1 \
-H 'user: myapiuser:200820e3227815ed1756a6b531e7e0d2' \
-F request=brand
or
curl -X POST \
http://api.remaps.com.tr/v1 \
-F request=brand \
-F user=myapiuser:200820e3227815ed1756a6b531e7e0d2
curl uses the -H
flag to pass header HTTP_
data and -F
flag to pass post data
Variables
-
request
The type of request. Required on single url method. Can be:
brand
,model
,year
,engine
, orstage
. -
user
Required if header user data is not included. Should be username and md5 crypted password seperated by
:
likemyapiuser:200820e3227815ed1756a6b531e7e0d2
-
parent_url
Required except for brands if parent_id is not included. Send parent items url to get child items of its. It's provided as url on parent items data.
-
parent_id
Required except for brands if parent_url is not included. Send parent items id to get child items of its. It's provided as id on parent items data.
Results
-
status
Boolean
Is request succeed. -
code
Integer
Is request succeed or reason if it's not succeed. -
error
String
Explanation of error if request is not succeed. -
items
Array
Results of request. -
id
Integer
ID of item. -
title
String
Title of item -
url
String
Auto generated url string for item -
alias
String
Auto generated url alias for item -
parent
Integer
ID of parent item -
is_development
Boolean
If engine type is under development mode. -
hp , nm
Integer
Default hp and torque values of engine. -
fuel_type
Integer
Fuel type of engine. 1 -Gasoline
2 -Diesel
3 -Hybrid
0 -Unidentified
-
hp_org , nm_org
Integer
Original hp and torque data of engine -
hp_new , nm_new
Integer
Hp and torque data after chip tuning -
hp_diff , nm_diff
Integer
Hp and torque data difference after chip tuning -
economy
Integer
Fuel economy after chip tuning as percent
Items
Brands
Request:
curl -X POST \
http://api.remaps.com.tr/v1 \
-H 'user: myapiuser:200820e3227815ed1756a6b531e7e0d2' \
-F request=brand
Result:
{ "status":true, "code":1, "items":[ {"id":"1","title":"Alfa Romeo","url":"alfa-romeo","alias":"alfa-romeo"}, {"id":"2","title":"Alpina","url":"alpina","alias":"alpina"}, {"id":"3","title":"Aston Martin","url":"aston-martin","alias":"aston-martin"}, {"id":"4","title":"Audi","url":"audi","alias":"audi"}, ... ] }
Models
Request:
curl -X POST \
http://api.remaps.com.tr/v1 \
-H 'user: myapiuser:200820e3227815ed1756a6b531e7e0d2' \
-F request=model \
-F parent_id=1
Result:
{ "status":true, "code":1, "items":[ { "id":"1", "title":"147", "parent":"1", "status":"1", "alias":"147", "url":"alfa-romeo\/147", "brand":{"id":"1","title":"Alfa Romeo","url":"alfa-romeo","alias":"alfa-romeo"} }, { "id":"2", "title":"156", "parent":"1", "alias":"156", "url":"alfa-romeo\/156", "brand":{"id":"1","title":"Alfa Romeo","url":"alfa-romeo","alias":"alfa-romeo"} }, ... ] }
Years
Request:
curl -X POST \
http://api.remaps.com.tr/v1 \
-H 'user: myapiuser:200820e3227815ed1756a6b531e7e0d2' \
-F request=year \
-F parent_id=1
Result:
{ "status":true, "code":1, "items":[ { "id":"1", "title":"2001 -> 2005", "parent":"1", "alias":"2001-2005", "url":"alfa-romeo\/147\/2001-2005", "model":{ "id":"1", "title":"147", "parent":"1", "alias":"147", "url":"alfa-romeo\/147", "brand":{"id":"1","title":"Alfa Romeo","url":"alfa-romeo","alias":"alfa-romeo"} } }, ... ] }
Engines
Request:
curl -X POST \
http://api.remaps.com.tr/v1 \
-H 'user: myapiuser:200820e3227815ed1756a6b531e7e0d2' \
-F request=engine \
-F parent_id=1
Result:
{ "status":true, "code":1, "items":[ { "id":"1", "title":"2.0 TS", "parent":"1", "alias":"2.0-ts-150hp", "url":"alfa-romeo\/147\/2001-2005\/2.0-ts-150hp", "fuel_type":"1", "hp":"150", "nm":"172", "is_development":0, "year":{ "id":"1", "title":"2001 -> 2005", "parent":"1", "alias":"2001-2005", "url":"alfa-romeo\/147\/2001-2005", "model":{ "id":"1", "title":"147", "parent":"1", "alias":"147", "url":"alfa-romeo\/147", "brand":{"id":"1","title":"Alfa Romeo","url":"alfa-romeo","alias":"alfa-romeo"} } } }, ... ] }
Stages
Request:
curl -X POST \
http://api.remaps.com.tr/v1 \
-H 'user: myapiuser:200820e3227815ed1756a6b531e7e0d2' \
-F request=stage \
-F parent_id=1
Result:
{ "status":true, "code":1, "items":[ { "id":"2", "title":"stage 1", "parent":"1", "alias":"stage-1", "url":"alfa-romeo\/147\/2001-2005\/2.0-ts-150hp\/stage-1", "economy":"6", "hp_org":"150", "hp_new":"165", "hp_diff":"15", "nm_org":"172", "nm_new":"192", "nm_diff":"20", "engine":{ "id":"1", "title":"2.0 TS", "parent":"1", "alias":"2.0-ts-150hp", "url":"alfa-romeo\/147\/2001-2005\/2.0-ts-150hp", "fuel_type":"1", "hp":"150", "nm":"172", "is_development":0, "year":{ "id":"1", "title":"2001 -> 2005", "parent":"1", "alias":"2001-2005", "url":"alfa-romeo\/147\/2001-2005", "model":{ "id":"1", "title":"147", "parent":"1", "alias":"147", "url":"alfa-romeo\/147", "brand":{"id":"1","title":"Alfa Romeo","url":"alfa-romeo","alias":"alfa-romeo"} } } } } ... ] }
Status Codes
-
1
Succeed
-
100
Username or password is wrong.
-
101
Membership has expired
-
102
Your account is not activated
-
200
No items found
-
201
One of parent_id or parent_url must included to request
-
202
No parent data found
-
203
parend_id and parent_url is not match as single item.