Swagger compliant

Added by Gustav almost 3 years ago

It would be a huge gain to all developers if you would make your swagger specification compliant. It would allow client code to be auto generated to almost any language.

What I got using the validator option for go-swagger:

The swagger spec at "https://api.test.nordnet.se/next/2/api-docs/swagger" is invalid against swagger specification . see errors :
- .swagger in body is required
- .paths in body is required
- .apiVersion in body is a forbidden property
- .swaggerVersion in body is a forbidden property
- .authorizations in body is a forbidden property
- .apis in body is a forbidden property
- info.version in body is required


Replies (10)

RE: Swagger compliant - Added by Dorte almost 3 years ago

Hi,

1) I agree it would be nice

2) there is a workaround

somehow I got around this last year by copying the swagger files from the browser

https://api.test.nordnet.se/next/2/api-docs/swagger/accounts etc.

to local files and add a resourcepath to each file. My local file stucture was something like
..\src\Json\Nordnet
accounts
countries
...

and I added the path to my directory structure as a parameter to my scala call this way :

-DfileMap=<mypath>\src\Json\Nordnet

Hope this can help
Dorte

RE: Swagger compliant - Added by Dorte almost 3 years ago

ups I forgot the resourcepath, here it is for accounts

"resourcePath": "/next/2/accounts",

it goes in after the basePath

RE: Swagger compliant - Added by Nordnet Simon almost 3 years ago

Hi, our swagger documentation is version 1.2, go-swagger seems to use Swagger 2.0.

We really want to be able to support Swagger 2.0 so it will be easier for people to build clients.

We have tried to use version 2.0 but swagger-ui was to slow when we added more endpoints - it seems to reload the json completely a lot of times. We will give it a new try later this year and see if the performance in swagger-ui has improved.

RE: Swagger compliant - Added by Henrik almost 2 years ago

Any updates on this?

RE: Swagger compliant - Added by Dan 8 months ago

No updates yet? When?

RE: Swagger compliant - Added by Dan 8 months ago

Converted swagger v1.2 to swagger v2 via a webtool
Included file.

PLEASE TEST AND VERIFY! It was an automated conversion.

You can't import it directly to VS 2015 but you can let the swagger editor (https://editor.swagger.io//) generate a C# client. And build from that.

Maybe this link can be useful http://visualbean.io/blog/how-to-use-the-autogenerated-swagger-client/

Best regards
Dan

RE: Swagger compliant - Added by Dan 8 months ago

File didn't upload. Pasted text below.

Please note it's untested and it was auto converted via a site!
I think some of the basepaths and other properties needs to be changed but it's better then nothing. :)

nordnet.next.v2.swagger.v2.json

{
"swagger": "2.0",
"info": {
"version": "2",
"title": "Nordnet External API - HTTP requests",
"description": "This documentation describes the HTTP requests of nExt. Please login above to be able to test the http requests. Please note that this is a test environment. There is no access here to the real production data"
},
"host": "api.test.nordnet.se",
"basePath": "/next/2/api-docs/swagger",
"securityDefinitions": {
"auth": {
"type": "basic",
"x-testValue": [],
"x-skip-client-authentication": false
}
},
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/next/2": {
"get": {
"description": "Get system status info",
"summary": "get_status",
"tags": [
"system"
],
"operationId": "Next2Get",
"produces": [
"application/json"
],
"parameters": [ {
"name": "Accept-Language",
"in": "header",
"required": false,
"enum": [
"en",
"sv",
"fi",
"da",
"no",
"nb",
"nn"
],
"x-enum-elements": [ {
"name": "en",
"description": ""
}, {
"name": "sv",
"description": ""
}, {
"name": "fi",
"description": ""
}, {
"name": "da",
"description": ""
}, {
"name": "no",
"description": ""
}, {
"name": "nb",
"description": ""
}, {
"name": "nn",
"description": ""
}
],
"type": "string",
"description": "Language prefered in the response. Note: nb and nn will return the same as no"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/Status"
},
"examples": {}
},
"429": {
"description": "Too Many Requests, please wait for 10 seconds before trying again",
"schema": {}
}
},
"security": [ {
"auth": []
}
],
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
},
"/next/2/accounts": {
"get": {
"description": "Get user accounts",
"summary": "get_accounts",
"tags": [
"accounts"
],
"operationId": "Next2AccountsGet",
"produces": [
"application/json"
],
"parameters": [ {
"name": "Accept-Language",
"in": "header",
"required": false,
"enum": [
"en",
"sv",
"fi",
"da",
"no",
"nb",
"nn"
],
"x-enum-elements": [ {
"name": "en",
"description": ""
}, {
"name": "sv",
"description": ""
}, {
"name": "fi",
"description": ""
}, {
"name": "da",
"description": ""
}, {
"name": "no",
"description": ""
}, {
"name": "nb",
"description": ""
}, {
"name": "nn",
"description": ""
}
],
"type": "string",
"description": "Language prefered in the response. Note: nb and nn will return the same as no"
}, {
"name": "Authorization",
"in": "header",
"required": false,
"type": "string",
"description": "Basic auth. The session_id should be sent as both username and password"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Account"
}
},
"examples": {}
},
"401": {
"description": "Invalid session",
"schema": {}
},
"403": {
"description": "User is logged in but user or system does not have priviliges to use this endpoint",
"schema": {}
},
"429": {
"description": "Too Many Requests, please wait for 10 seconds before trying again",
"schema": {}
}
},
"security": [ {
"auth": []
}
],
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
},
"/next/2/accounts/{accno}": {
"get": {
"description": "Get account summary",
"summary": "get_account",
"tags": [
"accounts"
],
"operationId": "Next2AccountsByAccnoGet",
"produces": [
"application/json"
],
"parameters": [ {
"name": "accno",
"in": "path",
"required": true,
"type": "integer",
"format": "int64",
"description": "The account number of the account to use"
}, {
"name": "Accept-Language",
"in": "header",
"required": false,
"enum": [
"en",
"sv",
"fi",
"da",
"no",
"nb",
"nn"
],
"x-enum-elements": [ {
"name": "en",
"description": ""
}, {
"name": "sv",
"description": ""
}, {
"name": "fi",
"description": ""
}, {
"name": "da",
"description": ""
}, {
"name": "no",
"description": ""
}, {
"name": "nb",
"description": ""
}, {
"name": "nn",
"description": ""
}
],
"type": "string",
"description": "Language prefered in the response. Note: nb and nn will return the same as no"
}, {
"name": "Authorization",
"in": "header",
"required": false,
"type": "string",
"description": "Basic auth. The session_id should be sent as both username and password"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/AccountInfo"
},
"examples": {}
},
"400": {
"description": "Invalid parameter",
"schema": {}
},
"401": {
"description": "Invalid session",
"schema": {}
},
"403": {
"description": "User is logged in but user or system does not have priviliges to use this endpoint",
"schema": {}
},
"429": {
"description": "Too Many Requests, please wait for 10 seconds before trying again",
"schema": {}
}
},
"security": [ {
"auth": []
}
],
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
},
"/next/2/accounts/{accno}/ledgers": {
"get": {
"description": "Get account ledgers",
"summary": "get_ledgers",
"tags": [
"accounts"
],
"operationId": "Next2AccountsLedgersByAccnoGet",
"produces": [
"application/json"
],
"parameters": [ {
"name": "accno",
"in": "path",
"required": true,
"type": "integer",
"format": "int64",
"description": "The account number of the account to use"
}, {
"name": "Accept-Language",
"in": "header",
"required": false,
"enum": [
"en",
"sv",
"fi",
"da",
"no",
"nb",
"nn"
],
"x-enum-elements": [ {
"name": "en",
"description": ""
}, {
"name": "sv",
"description": ""
}, {
"name": "fi",
"description": ""
}, {
"name": "da",
"description": ""
}, {
"name": "no",
"description": ""
}, {
"name": "nb",
"description": ""
}, {
"name": "nn",
"description": ""
}
],
"type": "string",
"description": "Language prefered in the response. Note: nb and nn will return the same as no"
}, {
"name": "Authorization",
"in": "header",
"required": false,
"type": "string",
"description": "Basic auth. The session_id should be sent as both username and password"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/LedgerInformation"
},
"examples": {}
},
"400": {
"description": "Invalid parameter",
"schema": {}
},
"401": {
"description": "Invalid session",
"schema": {}
},
"403": {
"description": "User is logged in but user or system does not have priviliges to use this endpoint",
"schema": {}
},
"429": {
"description": "Too Many Requests, please wait for 10 seconds before trying again",
"schema": {}
}
},
"security": [ {
"auth": []
}
],
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
},
"/next/2/accounts/{accno}/orders": {
"get": {
"description": "Get orders",
"summary": "get_orders",
"tags": [
"accounts"
],
"operationId": "Next2AccountsOrdersByAccnoGet",
"produces": [
"application/json"
],
"parameters": [ {
"name": "accno",
"in": "path",
"required": true,
"type": "integer",
"format": "int64",
"description": "The account number of the account to use"
}, {
"name": "deleted",
"in": "query",
"required": false,
"default": false,
"type": "boolean",
"description": "Include orders deleted today"
}, {
"name": "Accept-Language",
"in": "header",
"required": false,
"enum": [
"en",
"sv",
"fi",
"da",
"no",
"nb",
"nn"
],
"x-enum-elements": [ {
"name": "en",
"description": ""
}, {
"name": "sv",
"description": ""
}, {
"name": "fi",
"description": ""
}, {
"name": "da",
"description": ""
}, {
"name": "no",
"description": ""
}, {
"name": "nb",
"description": ""
}, {
"name": "nn",
"description": ""
}
],
"type": "string",
"description": "Language prefered in the response. Note: nb and nn will return the same as no"
}, {
"name": "Authorization",
"in": "header",
"required": false,
"type": "string",
"description": "Basic auth. The session_id should be sent as both username and password"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Order"
}
},
"examples": {}
},
"400": {
"description": "Invalid parameter",
"schema": {}
},
"401": {
"description": "Invalid session",
"schema": {}
},
"403": {
"description": "User is logged in but user or system does not have priviliges to use this endpoint",
"schema": {}
},
"429": {
"description": "Too Many Requests, please wait for 10 seconds before trying again",
"schema": {}
}
},
"security": [ {
"auth": []
}
],
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
},
"post": {
"description": "Enter order",
"summary": "create_order",
"tags": [
"accounts"
],
"operationId": "Next2AccountsOrdersByAccnoPost",
"produces": [
"application/json"
],
"consumes": [
"application/x-www-form-urlencoded"
],
"parameters": [ {
"name": "accno",
"in": "path",
"required": true,
"type": "integer",
"format": "int64",
"description": "The account number of the account to use"
}, {
"name": "market_id",
"in": "formData",
"required": true,
"type": "integer",
"format": "int64",
"description": "Nordnet market identifier"
}, {
"name": "volume",
"in": "formData",
"required": true,
"type": "integer",
"format": "int64",
"description": "The volume of the order"
}, {
"name": "side",
"in": "formData",
"required": true,
"enum": [
"BUY",
"SELL"
],
"x-enum-elements": [ {
"name": "BUY",
"description": ""
}, {
"name": "SELL",
"description": ""
}
],
"type": "string",
"description": "BUY or SELL"
}, {
"name": "identifier",
"in": "formData",
"required": false,
"type": "string",
"description": "Nordnet tradable identifier"
}, {
"name": "price",
"in": "formData",
"required": false,
"type": "number",
"format": "double",
"description": "The price limit of the order"
}, {
"name": "currency",
"in": "formData",
"required": false,
"type": "string",
"description": "The currency that the instrument is traded in"
}, {
"name": "order_type",
"in": "formData",
"required": false,
"enum": [
"FAK",
"FOK",
"NORMAL",
"LIMIT",
"STOP_LIMIT",
"STOP_TRAILING",
"OCO"
],
"x-enum-elements": [ {
"name": "FAK",
"description": ""
}, {
"name": "FOK",
"description": ""
}, {
"name": "NORMAL",
"description": ""
}, {
"name": "LIMIT",
"description": ""
}, {
"name": "STOP_LIMIT",
"description": ""
}, {
"name": "STOP_TRAILING",
"description": ""
}, {
"name": "OCO",
"description": ""
}
],
"default": "NORMAL",
"type": "string",
"description": "NORMAL is the default if order_type is left out, when using NORMAL the system guess the order type based on used parameters. In order to get better parameter validation and to ensure that the order type is the desired the client should not use NORMAL, please user the intended order type. NORMAL will be deprecated in future versions"
}, {
"name": "valid_until",
"in": "formData",
"required": false,
"type": "string",
"format": "date",
"description": "Date on format YYYY-MM-DD, if left out the order is a day order - same behavior as if valid_date should be set to today. Smart-orders can only be day orders"
}, {
"name": "open_volume",
"in": "formData",
"required": false,
"type": "integer",
"format": "int64",
"description": "The visible part of an iceberg order. If left out the whole volume of the order is visible on the market. This field is only allowed if the order type is LIMIT or NORMAL"
}, {
"name": "reference",
"in": "formData",
"required": false,
"type": "string",
"description": "Free text reference for the order. Intended for the end user"
}, {
"name": "activation_condition",
"in": "formData",
"required": false,
"type": "string",
"description": "Used for stop loss orders.<br> STOP_ACTPRICE_PERC - Trailing stop loss. The order is activated when the price changes by percent. The fields target_value, trigger_value and trigger_condition is required and the price field should not be set<br> STOP_ACTPRICE - The order is activated when the market price of the instrument reaches a trigger price. The fields trigger_value, trigger_condition and price is required<br> MANUAL - The order is inactive in the Nordne system until it is manually activated by a user<BR> OCO_STOP_ACTPRICE - One cancels other orders - Our implementation is one normal order and one stop loss order. If the real order is executed the stop loss is cancelled. If the stop loss triggers the normal order is canceled. This combo is always displayed as 1 order"
}, {
"name": "trigger_value",
"in": "formData",
"required": false,
"type": "number",
"format": "double",
"description": "If type is STOP_ACTPRICE_PERC the value is the given in percent. Minimum value is 1 for STOP_ACTPRICE_PERC. If type is STOP_ACTPRICE the value is a fixed price"
}, {
"name": "trigger_condition",
"in": "formData",
"required": false,
"type": "string",
"description": "The comparision that should be used on trigger_value <= or >="
}, {
"name": "target_value",
"in": "formData",
"required": false,
"type": "number",
"format": "double",
"description": "Only used when type is STOP_ACTPRICE_PERC or OCO_STOP_ACTPRICE. This is the price on the market.If type is STOP_ACTPRICE_PERC the value is given in percent. The price will be trailing_value + (target_value% of trailing_value). If type is OCO_STOP_ACTPRICE the price is a fixed price"
}, {
"name": "Accept-Language",
"in": "header",
"required": false,
"enum": [
"en",
"sv",
"fi",
"da",
"no",
"nb",
"nn"
],
"x-enum-elements": [ {
"name": "en",
"description": ""
}, {
"name": "sv",
"description": ""
}, {
"name": "fi",
"description": ""
}, {
"name": "da",
"description": ""
}, {
"name": "no",
"description": ""
}, {
"name": "nb",
"description": ""
}, {
"name": "nn",
"description": ""
}
],
"type": "string",
"description": "Language prefered in the response. Note: nb and nn will return the same as no"
}, {
"name": "Authorization",
"in": "header",
"required": false,
"type": "string",
"description": "Basic auth. The session_id should be sent as both username and password"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/OrderReply"
},
"examples": {}
},
"400": {
"description": "Invalid parameter",
"schema": {}
},
"401": {
"description": "Invalid session",
"schema": {}
},
"403": {
"description": "User is logged in but user or system does not have priviliges to use this endpoint",
"schema": {}
},
"429": {
"description": "Too Many Requests, please wait for 10 seconds before trying again",
"schema": {}
}
},
"security": [ {
"auth": []
}
],
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
},
"/next/2/accounts/{accno}/orders/{order_id}/activate": {
"put": {
"description": "Activate an order",
"summary": "order_activation",
"tags": [
"accounts"
],
"operationId": "Next2AccountsOrdersActivateByAccnoAndOrderIdPut",
"produces": [
"application/json"
],
"parameters": [ {
"name": "accno",
"in": "path",
"required": true,
"type": "integer",
"format": "int64",
"description": "The account in use"
}, {
"name": "order_id",
"in": "path",
"required": true,
"type": "integer",
"format": "int64",
"description": "The order to modify"
}, {
"name": "Accept-Language",
"in": "header",
"required": false,
"enum": [
"en",
"sv",
"fi",
"da",
"no",
"nb",
"nn"
],
"x-enum-elements": [ {
"name": "en",
"description": ""
}, {
"name": "sv",
"description": ""
}, {
"name": "fi",
"description": ""
}, {
"name": "da",
"description": ""
}, {
"name": "no",
"description": ""
}, {
"name": "nb",
"description": ""
}, {
"name": "nn",
"description": ""
}
],
"type": "string",
"description": "Language prefered in the response. Note: nb and nn will return the same as no"
}, {
"name": "Authorization",
"in": "header",
"required": false,
"type": "string",
"description": "Basic auth. The session_id should be sent as both username and password"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/OrderReply"
},
"examples": {}
},
"400": {
"description": "Invalid parameter",
"schema": {}
},
"401": {
"description": "Invalid session",
"schema": {}
},
"403": {
"description": "User is logged in but user or system does not have priviliges to use this endpoint",
"schema": {}
},
"429": {
"description": "Too Many Requests, please wait for 10 seconds before trying again",
"schema": {}
}
},
"security": [ {
"auth": []
}
],
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
},
"/next/2/accounts/{accno}/orders/{order_id}": {
"put": {
"description": "Modify an order",
"summary": "modify_order",
"tags": [
"accounts"
],
"operationId": "Next2AccountsOrdersByAccnoAndOrderIdPut",
"produces": [
"application/json"
],
"parameters": [ {
"name": "accno",
"in": "path",
"required": true,
"type": "integer",
"format": "int64",
"description": "The account number of the account to use"
}, {
"name": "order_id",
"in": "path",
"required": true,
"type": "integer",
"format": "int64",
"description": "The order to modify"
}, {
"name": "volume",
"in": "query",
"required": false,
"type": "integer",
"format": "int64",
"description": "The new volume"
}, {
"name": "price",
"in": "query",
"required": false,
"type": "number",
"format": "double",
"description": "The new price. If left out the price is not changed"
}, {
"name": "currency",
"in": "query",
"required": false,
"type": "string",
"description": "The currency of the instrument. Needed when the price is changed"
}, {
"name": "Accept-Language",
"in": "header",
"required": false,
"enum": [
"en",
"sv",
"fi",
"da",
"no",
"nb",
"nn"
],
"x-enum-elements": [ {
"name": "en",
"description": ""
}, {
"name": "sv",
"description": ""
}, {
"name": "fi",
"description": ""
}, {
"name": "da",
"description": ""
}, {
"name": "no",
"description": ""
}, {
"name": "nb",
"description": ""
}, {
"name": "nn",
"description": ""
}
],
"type": "string",
"description": "Language prefered in the response. Note: nb and nn will return the same as no"
}, {
"name": "Authorization",
"in": "header",
"required": false,
"type": "string",
"description": "Basic auth. The session_id should be sent as both username and password"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/OrderReply"
},
"examples": {}
},
"400": {
"description": "Invalid parameter",
"schema": {}
},
"401": {
"description": "Invalid session",
"schema": {}
},
"403": {
"description": "User is logged in but user or system does not have priviliges to use this endpoint",
"schema": {}
},
"404": {
"description": "Order not found",
"schema": {}
},
"429": {
"description": "Too Many Requests, please wait for 10 seconds before trying again",
"schema": {}
}
},
"security": [ {
"auth": []
}
],
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
},
"delete": {
"description": "Delete an order",
"summary": "delete_order",
"tags": [
"accounts"
],
"operationId": "Next2AccountsOrdersByAccnoAndOrderIdDelete",
"produces": [
"application/json"
],
"parameters": [ {
"name": "accno",
"in": "path",
"required": true,
"type": "integer",
"format": "int64",
"description": "The account number of the account to use"
}, {
"name": "order_id",
"in": "path",
"required": true,
"type": "integer",
"format": "int64",
"description": "The order to delete"
}, {
"name": "Accept-Language",
"in": "header",
"required": false,
"enum": [
"en",
"sv",
"fi",
"da",
"no",
"nb",
"nn"
],
"x-enum-elements": [ {
"name": "en",
"description": ""
}, {
"name": "sv",
"description": ""
}, {
"name": "fi",
"description": ""
}, {
"name": "da",
"description": ""
}, {
"name": "no",
"description": ""
}, {
"name": "nb",
"description": ""
}, {
"name": "nn",
"description": ""
}
],
"type": "string",
"description": "Language prefered in the response. Note: nb and nn will return the same as no"
}, {
"name": "Authorization",
"in": "header",
"required": false,
"type": "string",
"description": "Basic auth. The session_id should be sent as both username and password"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/OrderReply"
},
"examples": {}
},
"400": {
"description": "Invalid parameter",
"schema": {}
},
"401": {
"description": "Invalid session",
"schema": {}
},
"403": {
"description": "User is logged in but user or system does not have priviliges to use this endpoint",
"schema": {}
},
"429": {
"description": "Too Many Requests, please wait for 10 seconds before trying again",
"schema": {}
}
},
"security": [ {
"auth": []
}
],
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
},
"/next/2/accounts/{accno}/positions": {
"get": {
"description": "Get account positions",
"summary": "get_positions",
"tags": [
"accounts"
],
"operationId": "Next2AccountsPositionsByAccnoGet",
"produces": [
"application/json"
],
"parameters": [ {
"name": "accno",
"in": "path",
"required": true,
"type": "integer",
"format": "int64",
"description": "The account number of the account to use"
}, {
"name": "Accept-Language",
"in": "header",
"required": false,
"enum": [
"en",
"sv",
"fi",
"da",
"no",
"nb",
"nn"
],
"x-enum-elements": [ {
"name": "en",
"description": ""
}, {
"name": "sv",
"description": ""
}, {
"name": "fi",
"description": ""
}, {
"name": "da",
"description": ""
}, {
"name": "no",
"description": ""
}, {
"name": "nb",
"description": ""
}, {
"name": "nn",
"description": ""
}
],
"type": "string",
"description": "Language prefered in the response. Note: nb and nn will return the same as no"
}, {
"name": "Authorization",
"in": "header",
"required": false,
"type": "string",
"description": "Basic auth. The session_id should be sent as both username and password"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Position"
}
},
"examples": {}
},
"400": {
"description": "Invalid parameter",
"schema": {}
},
"401": {
"description": "Invalid session",
"schema": {}
},
"403": {
"description": "User is logged in but user or system does not have priviliges to use this endpoint",
"schema": {}
},
"429": {
"description": "Too Many Requests, please wait for 10 seconds before trying again",
"schema": {}
}
},
"security": [ {
"auth": []
}
],
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
},
"/next/2/accounts/{accno}/trades": {
"get": {
"description": "Get trades",
"summary": "get_trades",
"tags": [
"accounts"
],
"operationId": "Next2AccountsTradesByAccnoGet",
"produces": [
"application/json"
],
"parameters": [ {
"name": "accno",
"in": "path",
"required": true,
"type": "integer",
"format": "int64",
"description": "The account to lookup orders for"
}, {
"name": "days",
"in": "query",
"required": false,
"default": 0,
"type": "integer",
"format": "int64",
"description": "Number of days to look for trades. Default is 0. 0 means trades from today. Max is 7 days"
}, {
"name": "Accept-Language",
"in": "header",
"required": false,
"enum": [
"en",
"sv",
"fi",
"da",
"no",
"nb",
"nn"
],
"x-enum-elements": [ {
"name": "en",
"description": ""
}, {
"name": "sv",
"description": ""
}, {
"name": "fi",
"description": ""
}, {
"name": "da",
"description": ""
}, {
"name": "no",
"description": ""
}, {
"name": "nb",
"description": ""
}, {
"name": "nn",
"description": ""
}
],
"type": "string",
"description": "Language prefered in the response. Note: nb and nn will return the same as no"
}, {
"name": "Authorization",
"in": "header",
"required": false,
"type": "string",
"description": "Basic auth. The session_id should be sent as both username and password"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Trade"
}
},
"examples": {}
},
"400": {
"description": "Invalid parameter",
"schema": {}
},
"401": {
"description": "Invalid session",
"schema": {}
},
"403": {
"description": "User is logged in but user or system does not have priviliges to use this endpoint",
"schema": {}
},
"404": {
"description": "Account not found",
"schema": {}
},
"429": {
"description": "Too Many Requests, please wait for 10 seconds before trying again",
"schema": {}
}
},
"security": [ {
"auth": []
}
],
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
},
"/next/2/countries": {
"get": {
"description": "Get all countries",
"summary": "get_countries",
"tags": [
"countries"
],
"operationId": "Next2CountriesGet",
"produces": [
"application/json"
],
"parameters": [ {
"name": "Accept-Language",
"in": "header",
"required": false,
"enum": [
"en",
"sv",
"fi",
"da",
"no",
"nb",
"nn"
],
"x-enum-elements": [ {
"name": "en",
"description": ""
}, {
"name": "sv",
"description": ""
}, {
"name": "fi",
"description": ""
}, {
"name": "da",
"description": ""
}, {
"name": "no",
"description": ""
}, {
"name": "nb",
"description": ""
}, {
"name": "nn",
"description": ""
}
],
"type": "string",
"description": "Language prefered in the response. Note: nb and nn will return the same as no"
}, {
"name": "Authorization",
"in": "header",
"required": false,
"type": "string",
"description": "Basic auth. The session_id should be sent as both username and password"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Country"
}
},
"examples": {}
},
"401": {
"description": "Invalid session",
"schema": {}
},
"429": {
"description": "Too Many Requests, please wait for 10 seconds before trying again",
"schema": {}
}
},
"security": [ {
"auth": []
}
],
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
},
"/next/2/countries/{country}": {
"get": {
"description": "Get country",
"summary": "get_country",
"tags": [
"countries"
],
"operationId": "Next2CountriesByCountryGet",
"produces": [
"application/json"
],
"parameters": [ {
"name": "country",
"in": "path",
"required": true,
"type": "string",
"description": "The country_code to lookup"
}, {
"name": "Accept-Language",
"in": "header",
"required": false,
"enum": [
"en",
"sv",
"fi",
"da",
"no",
"nb",
"nn"
],
"x-enum-elements": [ {
"name": "en",
"description": ""
}, {
"name": "sv",
"description": ""
}, {
"name": "fi",
"description": ""
}, {
"name": "da",
"description": ""
}, {
"name": "no",
"description": ""
}, {
"name": "nb",
"description": ""
}, {
"name": "nn",
"description": ""
}
],
"type": "string",
"description": "Language prefered in the response. Note: nb and nn will return the same as no"
}, {
"name": "Authorization",
"in": "header",
"required": false,
"type": "string",
"description": "Basic auth. The session_id should be sent as both username and password"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Country"
}
},
"examples": {}
},
"401": {
"description": "Invalid session",
"schema": {}
},
"429": {
"description": "Too Many Requests, please wait for 10 seconds before trying again",
"schema": {}
}
},
"security": [ {
"auth": []
}
],
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
},
"/next/2/indicators": {
"get": {
"description": "Get indicators",
"summary": "get_indicators",
"tags": [
"indicators"
],
"operationId": "Next2IndicatorsGet",
"produces": [
"application/json"
],
"parameters": [ {
"name": "Accept-Language",
"in": "header",
"required": false,
"enum": [
"en",
"sv",
"fi",
"da",
"no",
"nb",
"nn"
],
"x-enum-elements": [ {
"name": "en",
"description": ""
}, {
"name": "sv",
"description": ""
}, {
"name": "fi",
"description": ""
}, {
"name": "da",
"description": ""
}, {
"name": "no",
"description": ""
}, {
"name": "nb",
"description": ""
}, {
"name": "nn",
"description": ""
}
],
"type": "string",
"description": "Language prefered in the response. Note: nb and nn will return the same as no"
}, {
"name": "Authorization",
"in": "header",
"required": false,
"type": "string",
"description": "Basic auth. The session_id should be sent as both username and password"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Indicator"
}
},
"examples": {}
},
"401": {
"description": "Invalid session",
"schema": {}
},
"429": {
"description": "Too Many Requests, please wait for 10 seconds before trying again",
"schema": {}
}
},
"security": [ {
"auth": []
}
],
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
},
"/next/2/indicators/{indicator}": {
"get": {
"description": "Get indicator info",
"summary": "get_indicator",
"tags": [
"indicators"
],
"operationId": "Next2IndicatorsByIndicatorGet",
"produces": [
"application/json"
],
"parameters": [ {
"name": "indicator",
"in": "path",
"required": true,
"type": "string",
"description": "The indicator on the format [src]:[identifier], comma separate multiple inputs"
}, {
"name": "Accept-Language",
"in": "header",
"required": false,
"enum": [
"en",
"sv",
"fi",
"da",
"no",
"nb",
"nn"
],
"x-enum-elements": [ {
"name": "en",
"description": ""
}, {
"name": "sv",
"description": ""
}, {
"name": "fi",
"description": ""
}, {
"name": "da",
"description": ""
}, {
"name": "no",
"description": ""
}, {
"name": "nb",
"description": ""
}, {
"name": "nn",
"description": ""
}
],
"type": "string",
"description": "Language prefered in the response. Note: nb and nn will return the same as no"
}, {
"name": "Authorization",
"in": "header",
"required": false,
"type": "string",
"description": "Basic auth. The session_id should be sent as both username and password"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Indicator"
}
},
"examples": {}
},
"400": {
"description": "Invalid parameter",
"schema": {}
},
"401": {
"description": "Invalid session",
"schema": {}
},
"429": {
"description": "Too Many Requests, please wait for 10 seconds before trying again",
"schema": {}
}
},
"security": [ {
"auth": []
}
],
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
},
"/next/2/instruments": {
"get": {
"description": "Instrument search",
"summary": "get_instruments",
"tags": [
"instruments"
],
"operationId": "Next2InstrumentsGet",
"produces": [
"application/json"
],
"parameters": [ {
"name": "query",
"in": "query",
"required": true,
"type": "string",
"description": "The query string"
}, {
"name": "instrument_group_type",
"in": "query",
"required": false,
"type": "array",
"uniqueItems": false,
"items": {
"type": "string"
},
"description": "Instrument group type to search for. If empty all instrument group types is used. Multiple group types should be comma separated"
}, {
"name": "limit",
"in": "query",
"required": false,
"default": 100,
"type": "integer",
"format": "int64",
"description": "Max number of items in the reply. Max value is 100. Default is 100"
}, {
"name": "offset",
"in": "query",
"required": false,
"default": 0,
"type": "integer",
"format": "int64",
"description": "Used together with limit to create pagination. This is the first instrument to show. Defaults to 0"
}, {
"name": "fuzzy",
"in": "query",
"required": false,
"default": false,
"type": "boolean",
"description": "To perform a approximate string search, set fuzzy to true"
}, {
"name": "Accept-Language",
"in": "header",
"required": false,
"enum": [
"en",
"sv",
"fi",
"da",
"no",
"nb",
"nn"
],
"x-enum-elements": [ {
"name": "en",
"description": ""
}, {
"name": "sv",
"description": ""
}, {
"name": "fi",
"description": ""
}, {
"name": "da",
"description": ""
}, {
"name": "no",
"description": ""
}, {
"name": "nb",
"description": ""
}, {
"name": "nn",
"description": ""
}
],
"type": "string",
"description": "Language prefered in the response. Note: nb and nn will return the same as no"
}, {
"name": "Authorization",
"in": "header",
"required": false,
"type": "string",
"description": "Basic auth. The session_id should be sent as both username and password"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Instrument"
}
},
"examples": {}
},
"400": {
"description": "Invalid parameter",
"schema": {}
},
"401": {
"description": "Invalid session",
"schema": {}
},
"429": {
"description": "Too Many Requests, please wait for 10 seconds before trying again",
"schema": {}
}
},
"security": [ {
"auth": []
}
],
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
},
"/next/2/instruments/{instrument_id}": {
"get": {
"description": "Get instruments",
"summary": "get_instrument",
"tags": [
"instruments"
],
"operationId": "Next2InstrumentsByInstrumentIdGet",
"produces": [
"application/json"
],
"parameters": [ {
"name": "instrument_id",
"in": "path",
"required": true,
"type": "integer",
"format": "int64",
"description": "The unique instrument id, comma separate multiple inputs"
}, {
"name": "Accept-Language",
"in": "header",
"required": false,
"enum": [
"en",
"sv",
"fi",
"da",
"no",
"nb",
"nn"
],
"x-enum-elements": [ {
"name": "en",
"description": ""
}, {
"name": "sv",
"description": ""
}, {
"name": "fi",
"description": ""
}, {
"name": "da",
"description": ""
}, {
"name": "no",
"description": ""
}, {
"name": "nb",
"description": ""
}, {
"name": "nn",
"description": ""
}
],
"type": "string",
"description": "Language prefered in the response. Note: nb and nn will return the same as no"
}, {
"name": "Authorization",
"in": "header",
"required": false,
"type": "string",
"description": "Basic auth. The session_id should be sent as both username and password"
}
],
"responses": {
"200": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Instrument"
}
},
"examples": {}
},
"400": {
"description": "Invalid parameter",
"schema": {}
},
"401": {
"description": "Invalid session",
"schema": {}
},
"429": {
"description": "Too Many Requests, please wait for 10 seconds before trying again",
"schema": {}
}
},
"security": [ {
"auth": []
}
],
"x-unitTests": [],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
},
"/next/2/instruments/{instrument_id}/leverages": {
"get": {
"description": "Get leverage instruments",
"summary": "get_leverages",
"tags": [
"instruments"
],
"operationId": "Next2InstrumentsLeveragesByInstrumentIdGet",
"produces": [
"application/json"
],
"parameters": [ {
"name": "instrument_id",
"in": "path",
"required": true,
"type": "integer",
"format": "int64",
"description": "The instrument id of the underlying instrument"
}, {
"name": "expiration_date",
"in": "query",
"required": false,
"type": "string",
"format": "date",
"description": "Show only leverage instruments with a specific expiration date"
}, {
"name": "issuer_id",
"in": "query",
"required": false,
"type": "integer",
"format": "int64",
"description": "Show only leverage instrumentsm from a specific issuer"
}, {
"name": "market_view",
"in": "query",
"required": false,
"enum": [
"D",
"U"
],
"x-enum-elements": [ {
"name": "D",
"description": ""
}, {
"name": "U",
"description": ""
}
],
"type": "string",
"description": "Show only leverage instruments with a specific market view"
}, {
"name": "instrument_type",
"in": "query",
"required": false,
"type": "string",
"description": "Show only instruments with a specific instrument type"
}, {
"name": "instrument_group_type",
"in": "query",
"required": false,
"type": "string",
"description": "Show only instruments with a specific instrument group type"
}, {
"name": "currency",
"in": "query",
"required": false,
"type": "string",
"description": "Show only leverage instruments with a specific currency"
}, {
"name": "Accept-Language",
"in": "header",
"required": false,
"enum": [
"en",
"sv",
"fi",
"da",
"no",
"nb",
"nn"
],
"x-enum-elements": [ {
"name": "en",
"description": ""
},

RE: Swagger compliant - Added by Dan 8 months ago

Sorry for the big post above.
Abit new at this.

RE: Swagger compliant - Added by Dan 8 months ago

Conversion was made with

https://apimatic.io/transformer

RE: Swagger compliant - Added by William 4 months ago

thanks for your sharing. It is really useful for my project - http://rolltheball.co and http://impossiblegame.co

(1-10/10)