Introduction
Welcome to the TradeFinex API! You can use our API to access TradeFinex API endpoints, which is Trade and Finance Platform.
We have language bindings in Shell, Javascript, and Json! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.
This example API documentation page was created with TradeFinex. Feel free to edit it and use it as a base for your own API's documentation.
Authentication
TradeFinex uses API key to allow access to the API. You can request a new API key at our developer portal.
Two ways to authenticate :
1) JWT Token - issued after using API
2) API Key based
The API Key and JWT Token needs to be included in the request body or as GET param during API call.
apiKey: '04af606c-38a3-11e8-b467-0ed5f89f718b'
token: '......jwt token.... '
API Interaction
Status codes
200 OK
Successful request400 Bad Request
Validation error401 Unauthorized
Invalid API Key404 Not Found
The specified resource does not exist500 Internal Server Error
Something went wrong
Response format
Depending on whether the request is successful or not the response format will change.
Endpoint specific data will exist in data object on successful request.
Successful repsonse format
{
"status" : "success",
"data" : {}
}
Failed repsonse format
{
"status" : "failed",
"appErrorCode": "",
"errMessage": ""
}
Errors
List of api errors and their mapping with http
status code.
Error Code | Status code | Error Message |
---|---|---|
1001 | 400 | The request was unacceptable, often due to missing a required parameter |
1002 | 400 | No value provided for mandatory resource |
1003 | 400 | The specified resource type does not match the required type |
1004 | 403 | The specified resource does not exist |
1005 | 400 | The resource exceeds the maximum allowed value of {{MAX}} |
1006 | 400 | The resource does not meet minimum required value of {{MIN}} |
1007 | 400 | The resource does not match required size of {{SIZE}} |
1008 | 409 | Invalid email |
1009 | 400 | Invalid date format |
1010 | 400 | Invalid XDC address |
1011 | 400 | The specified resource is out of range |
1012 | 409 | Invalid value |
1101 | 401 | No valid API key provided |
1102 | 400 | Too many requests hit the API too quickly |
1103 | 409 | The specified account already exists |
1104 | 403 | Server failed to authenticate the request |
1105 | 500 | Internal Error |
1106 | 500 | DB Error |
1107 | 500 | Cannot send activation email to the user |
1108 | 500 | Cannot unlock account |
1109 | 500 | Cannot create new account |
1110 | 500 | Cannot send forgot password/reset email to the user |
1111 | 404 | Given email id does not exist |
1112 | 404 | Reset Link Expired |
1113 | 400 | Cannot change password. Enter correct detail |
1115 | 500 | Something went wrong. Cannot process the request |
1116 | 400 | Failed not enough balance |
1117 | 400 | Account is invalid |
1118 | 400 | Incorrect Password |
1119 | 400 | Invalid OTP (2FA) |
1120 | 400 | Cannot setup new account |
1121 | 404 | Account does not exists |
1122 | 400 | OTP Error |
1123 | 400 | API Key is invalid |
1124 | 400 | OTP Expired |
Versioning
Inorder to use v1.0 API version, use the following url address :
https://[host]/api/v1/[endpoint]
Endpoints - Admin
Most of the endpoint require authentication of some type (user/API Key authentication). Where not required appropriate note will be provided.
Check Account Existence
Check Admin UserList.
HTTP Request
GET http://[host]/api/AdminUser/ListAll/0
curl -X GET \
'http://[host]/api/AdminUser/ListAll/0' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NDA4MDcyOTksImV4cCI6MTU0MDg5MzY5OX0.ElthDyZJPXQ1xRMNjDU39AIXyaaB4z8V2TsMlPDS0nQ' \
The JSON encoded response on successful request
{
"UserID": 1,
"FirstName": "test",
"LastName": "test",
"UserName": "testa",
"Password": "test@123",
"EmailID": "test@gmail.com",
"MobileNo": "123456789",
"IsActive": true,
"CreateBy": 1,
"CreateDate": "2018-10-30T01:25:03.030Z",
"CreateIP": "::1",
"UpdateBy": 1,
"UpdateDate": "2018-10-30T01:34:52.723Z",
"UpdateIP": "::1"
}
Parameters
Argument | Type | Required |
---|---|---|
FirstName | String | yes |
LastName | String | yes |
UserName | String | yes |
Password | String | yes |
EmailID | String | yes |
IsActive | Boolean | yes |
CreateBy | Integer | yes |
Create Admin Account
Create new account for Admin user.
HTTP Request
POST http://[host]/api/AdminUser/Add
curl -X POST \
http://[host]/api/AdminUser/Add \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NDA4MDcyOTksImV4cCI6MTU0MDg5MzY5OX0.ElthDyZJPXQ1xRMNjDU39AIXyaaB4z8V2TsMlPDS0nQ' \
-d '{
"FirstName": "test",
"LastName": "test",
"UserName": "test123@gmail.com",
"Password": "test@123",
"EmailID": "test123@gmail.com",
"IsActive": true,
"CreateBy": 4
}'
The JSON encoded response on successful account creation
{
"result : success"
}
Parameters
Argument | Type | Required |
---|---|---|
FirstName | String | yes |
LastName | String | yes |
UserName | String | yes |
Password | String | yes |
EmailID | String | yes |
IsActive | Boolean | yes |
CreateBy | Integer | yes |
Update Admin Account
Update account for Admin user.
HTTP Request
PUT http://[host]/api/AdminUser/Update/
curl -X PUT \
http://[host]/api/AdminUser/Update/<updatedby> \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NDA4MDcyOTksImV4cCI6MTU0MDg5MzY5OX0.ElthDyZJPXQ1xRMNjDU39AIXyaaB4z8V2TsMlPDS0nQ' \
-d ' {
"FirstName": "test",
"LastName": "test",
"UserName": "test123@gmail.com",
"Password": "test@123",
"EmailID": "test123@gmail.com",
"IsActive": true,
"UpdateBy": 4
}'
The JSON encoded response on successful account creation
{
"result : success"
}
Parameters
Argument | Type | Required |
---|---|---|
FirstName | String | yes |
LastName | String | yes |
UserName | String | yes |
Password | String | yes |
EmailID | String | yes |
IsActive | Boolean | yes |
UpdateBy | Integer | yes |
Project Type List
Number of Project Type list existing
HTTP Request
GET http://[host]/api/ProjectType/ListAll/0
curl -X GET \
http://[host]/api/ProjectType/ListAll/0 \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NDA4MDcyOTksImV4cCI6MTU0MDg5MzY5OX0.ElthDyZJPXQ1xRMNjDU39AIXyaaB4z8V2TsMlPDS0nQ' \
The JSON encoded response on successful account creation
{
"ProjectTypeID": 1,
"ContractName": "Government",
"IsDeleted": false,
"CreateBy": 1,
"CreateDate": "2018-10-30T14:25:18.847Z",
"CreateIP": "192.168.1.1",
"UpdateBy": 1,
"UpdateDate": "2018-10-30T17:16:16.020Z",
"UpdateIP": "::ffff:86.98.6.219"
}
Parameters
Argument | Type |
---|---|
ProjectTypeID | Integer |
ContractName | String |
IsDeleted | String |
CreateBy | Integer |
Add Project Type
Add new Project Type
HTTP Request
POST http://[host]/api/ProjectType/Add
curl -X POST \
http://[host]/api/ProjectType/Add \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NDA4MDcyOTksImV4cCI6MTU0MDg5MzY5OX0.ElthDyZJPXQ1xRMNjDU39AIXyaaB4z8V2TsMlPDS0nQ' \
-d '
{
"ContractName": "Government",
"IsDeleted": false,
"CreateBy": 1
}
The JSON encoded response on successful account creation
{
"result : success"
}
Parameters
Argument | Type | Required |
---|---|---|
ContractName | String | yes |
IsDeleted | Boolean | yes |
CreateBy | Integer | yes |
Update Project Type
Update Project Type.
HTTP Request
PUT http://[host]/api/ProjectType/Update/
curl -X PUT \
http://[host]/api/ProjectType/Update/<updatedby> \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NDA4MDcyOTksImV4cCI6MTU0MDg5MzY5OX0.ElthDyZJPXQ1xRMNjDU39AIXyaaB4z8V2TsMlPDS0nQ' \
-d ' {
"ContractName": "Private",
"IsDeleted": "true",
"UpdateBy": 1
}'
The JSON encoded response on successful account creation
{
"result : success"
}
Parameters
Argument | Type | Required |
---|---|---|
ContractName | String | yes |
IsDeleted | Boolean | yes |
UpdateBy | Integer | yes |
Sector List
Number of Sector list existing
HTTP Request
GET http://[host]/api/Sector/ListAll/0
curl -X GET \
http://[host]/api/Sector/ListAll/0 \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NDA4MDcyOTksImV4cCI6MTU0MDg5MzY5OX0.ElthDyZJPXQ1xRMNjDU39AIXyaaB4z8V2TsMlPDS0nQ' \
The JSON encoded response on successful account creation
{
"SectorID": 3,
"SkillName": "testName",
"ImagePath": "folder/Image.jpg",
"IndustryID": 1,
"IsDeleted": false,
"CreateBy": 1,
"CreateDate": "2018-10-30T11:38:45.137Z",
"CreateIP": "::ffff:103.43.160.22",
"UpdateBy": 1,
"UpdateDate": "2018-10-30T11:38:45.137Z",
"UpdateIP": "::ffff:103.43.160.22",
"IndustryName": "Renewable"
}
Parameters
Argument | Type |
---|---|
SkillName | String |
ImagePath | Image |
IndustryName | String |
IsDeleted | Boolean |
CreateBy | Integer |
Add Sector
Add new Sector
HTTP Request
POST http://[host]/api/Sector/Add
curl -X POST \
http://[host]/api/Sector/Add \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NDA4MDcyOTksImV4cCI6MTU0MDg5MzY5OX0.ElthDyZJPXQ1xRMNjDU39AIXyaaB4z8V2TsMlPDS0nQ' \
-d '
{
"SkillName": "testName",
"ImagePath": "folder/Image.jpg",
"IndustryName": "Renewable",
"IsDeleted": false,
"CreateBy": 1
}'
The JSON encoded response on successful account creation
{
"result : success"
}
Parameters
Argument | Type | Required |
---|---|---|
SkillName | String | yes |
ImagePath | Image | yes |
IndustryName | String | yes |
IsDeleted | Boolean | yes |
CreateBy | Integer | yes |
Update Sector
Update Sector.
HTTP Request
PUT http://[host]/api/Sector/Update/
curl -X PUT \
http://[host]/api/Sector/Update/<updatedby> \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NDA4MDcyOTksImV4cCI6MTU0MDg5MzY5OX0.ElthDyZJPXQ1xRMNjDU39AIXyaaB4z8V2TsMlPDS0nQ' \
-d ' {
"SkillName": "testName",
"ImagePath": "folder/Image.jpg",
"IndustryName": "Renewable",
"IsDeleted": false,
"UpdateBy": 1
}'
The JSON encoded response on successful account creation
{
"result : success"
}
Parameters
Argument | Type | Required |
---|---|---|
SkillName | String | yes |
ImagePath | Image | yes |
IndustryName | String | yes |
IsDeleted | Boolean | yes |
UpdateBy | Integer | yes |
Industry
Number of Industry list existing
HTTP Request
GET http://[host]/api/Industry/ListAll/0
curl -X GET \
http://[host]/api/Industry/ListAll/0 \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NDA4MDcyOTksImV4cCI6MTU0MDg5MzY5OX0.ElthDyZJPXQ1xRMNjDU39AIXyaaB4z8V2TsMlPDS0nQ' \
The JSON encoded response on successful account creation
{
"IndustryID": 1,
"IndustryName": "Energy",
"ImagePath": "dsjkh/sdfds.jpg",
"IsDeleted": false,
"CreateBy": 1,
"CreateDate": "2018-10-301:55:02.263Z",
"CreateIP": "::1",
"UpdateBy": 1,
"UpdateDate": "2018-10-301:56:42.840Z",
"UpdateIP": "::1"
}```
### Parameters
Argument | Type
-------|-------
IndustryName| String
ImagePath| Image
IsDeleted| Boolean
CreateBy| Integer
## Add Industry
Add new Industry
### HTTP Request
<code>POST http://[host]/api/Industry/Add</code>
```shell
curl -X POST \
http://[host]/api/Industry/Add \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NDA4MDcyOTksImV4cCI6MTU0MDg5MzY5OX0.ElthDyZJPXQ1xRMNjDU39AIXyaaB4z8V2TsMlPDS0nQ' \
-d '
{
"IndustryName": "RTA",
"ImagePath": "folder/image.jpg",
"IsDeleted": false,
"CreateBy": 1
}```
> The JSON encoded response on successful account creation
```shell
{
"result : success"
}
Parameters
Argument | Type | Required |
---|---|---|
IndustryName | String | yes |
ImagePath | Image | yes |
IsDeleted | Boolean | yes |
CreateBy | Integer | yes |
Update Industry
Update Industry.
HTTP Request
PUT http://[host]/api/Industry/Update/
curl -X PUT \
http://[host]/api/Industry/Update/<updatedby> \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NDA4MDcyOTksImV4cCI6MTU0MDg5MzY5OX0.ElthDyZJPXQ1xRMNjDU39AIXyaaB4z8V2TsMlPDS0nQ' \
-d ' {
"IndustryName": "IT Industry",
"ImagePath": "folder/image.jpg",
"IsDeleted": false,
"UpdateBy": 1
}'
The JSON encoded response on successful account creation
{
"result : success"
}
Parameters
Argument | Type | Required |
---|---|---|
IndustryName | String | yes |
ImagePath | Image | yes |
IsDeleted | Boolean | yes |
UpdateBy | Integer | yes |