You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 13, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: docs/core-concepts/api-calls-anatomy/index.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,9 +24,9 @@ All API calls have a send functionality for making a request and receiving a res
24
24
25
25
Several API calls provide the `subscribe` functionality. When you subscribe to an API call, you will receive a continuous stream from data of this particular API call.
26
26
27
-
Some of these API calls automatically subscribe (e.g. [ticks](https://api.deriv.com/api-explorer#ticks)) and some have an optional `subscribe` field. If you pass `1` to the `subscribe` field, the subscription will start and the server will continue to send the requested data until you unsubscribe by calling the `Forget` or `Forget all` API calls.
27
+
Some of these API calls automatically subscribe (e.g. [ticks](/api-explorer#ticks)) and some have an optional `subscribe` field. If you pass `1` to the `subscribe` field, the subscription will start and the server will continue to send the requested data until you unsubscribe by calling the `Forget` or `Forget all` API calls.
28
28
29
-
For example, you can call [Tick History](https://api.deriv.com/api-explorer#ticks_history) to receive tick history data. But when you add the `subscribe` option to this call, you will receive the tick history data you requested in the first response, and you will continue to receive a new response every time there is a new tick published by the server for the given symbol.
29
+
For example, you can call [Tick History](/api-explorer#ticks_history) to receive tick history data. But when you add the `subscribe` option to this call, you will receive the tick history data you requested in the first response, and you will continue to receive a new response every time there is a new tick published by the server for the given symbol.
30
30
31
31
In the message stream from `subscribe`, there is a field called `subscription`. This is the `Stream ID`. With this ID, you can identify the message stream in your logic and stop the stream with `Forget` and `Forget All` API calls.
32
32
@@ -41,7 +41,7 @@ If you call the API with the `send` functionality, then the server will only sen
41
41
If you want to stop the message stream created by `subscribe`, you will have to call the `Forget` API call with the correct `Stream ID`. Otherwise, you can use the `Forget All` API call to stop streams by their `Method name`.
42
42
43
43
:::caution
44
-
For more information on the `Forget` API call, have a look at [Forget](https://api.deriv.com/api-explorer#forget) and [Forget All](https://api.deriv.com/api-explorer#forget_all) in the API explorer.
44
+
For more information on the `Forget` API call, have a look at [Forget](/api-explorer#forget) and [Forget All](/api-explorer#forget_all) in the API explorer.
45
45
:::
46
46
47
47
## Request data
@@ -64,15 +64,15 @@ A `Residence List` call returns a list of countries and 2-letter country codes,
64
64
65
65
The request data for this call is as below:
66
66
67
-
```ts
67
+
```ts showLineNumbers
68
68
{
69
69
residence_list: 1; // Api Call Method Name
70
70
passthrough?:object; // Optional
71
71
req_id?:number; // Optional
72
72
}
73
73
```
74
74
75
-
The `residence_list` field is the `method name` for the call and is required. There may be other required fields related to this type of the request you want to send. To know more about `Residence List` and other API calls, please check them out in [API Explorer](https://api.deriv.com/api-explorer#residence_list).
75
+
The `residence_list` field is the `method name` for the call and is required. There may be other required fields related to this type of the request you want to send. To know more about `Residence List` and other API calls, please check them out in [API Explorer](/api-explorer#residence_list).
76
76
77
77
### Optional fields
78
78
@@ -87,7 +87,7 @@ Whatever you pass to this field will be returned back to you inside a `response`
87
87
You may need to `tag` your requests and pass them through our `WebSocket` calls. You can do so by passing a `number` to this field. It can be helpful when you need to map `requests` to `responses`.
88
88
89
89
:::caution
90
-
To learn about additional optional fields specific to each API call, please refer to our [API Explorer](https://api.deriv.com/api-explorer).
90
+
To learn about additional optional fields specific to each API call, please refer to our [API Explorer](/api-explorer).
91
91
:::
92
92
93
93
## Response data
@@ -96,7 +96,7 @@ When you get the response for the call, there will be a `Field` with the same na
96
96
97
97
The response for the `Residence List` call:
98
98
99
-
```js
99
+
```js showLineNumbers
100
100
{
101
101
echo_req: {
102
102
req_id:1,
@@ -163,7 +163,7 @@ The response for the `Residence List` call:
163
163
};
164
164
```
165
165
166
-
Here the `residence_list` is the `method name`, and it contains the actual data you requested. To keep it short, we haven't included the rest of the array. You can check the actual response [here](https://api.deriv.com/api-explorer#residence_list).
166
+
Here the `residence_list` is the `method name`, and it contains the actual data you requested. To keep it short, we haven't included the rest of the array. You can check the actual response [here](/api-explorer#residence_list).
167
167
168
168
#### The `echo_req` field
169
169
@@ -173,7 +173,7 @@ This `Field` contains the exact `Request Data` you sent to the server.
173
173
174
174
This `Field` helps you determine which `message` data you're getting on the message event of the WebSocket connection. For example, your `onmessage` event handler for your WebSocket connection in `JavaScript` would be:
Copy file name to clipboardExpand all lines: docs/core-concepts/authorization-authentication/index.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ Please refer to [Setting up a Deriv application](docs/setting-up-a-deriv-applica
33
33
34
34
An API token is a unique identifier of a client that requests access from a server. It's the simplest way of authorisation.
35
35
36
-
The access level for each API token has to match the required access level of each API call, which can be found in the [API Explorer](https://api.deriv.com/api-explorer) as well.
36
+
The access level for each API token has to match the required access level of each API call, which can be found in the [API Explorer](/api-explorer) as well.
37
37
38
38
For example, on the screenshot below, you can see that to be able to use the Account Status, a token with read access level must be used.
39
39
@@ -71,7 +71,7 @@ Once a user signs up/logs in, they will be redirected to the URL that you entere
71
71
72
72
The query parameters in the redirect URL are the user's accounts and their related session tokens. You can map the query parameters to an array using the following approach:
73
73
74
-
```js
74
+
```js showLineNumbers
75
75
constuser_accounts= [
76
76
{
77
77
account:'cr799393',
@@ -86,17 +86,17 @@ const user_accounts = [
86
86
];
87
87
```
88
88
89
-
To authorise the user based on the user's **selected** account, call the [authorize](https://api.deriv.com/api-explorer#authorize) API call with the user's **selected** account **session token**:
89
+
To authorise the user based on the user's **selected** account, call the [authorize](/api-explorer#authorize) API call with the user's **selected** account **session token**:
90
90
91
-
```js
91
+
```js showLineNumbers
92
92
{
93
93
"authorize":"a1-f7pnteezo4jzhpxclctizt27hyeot"
94
94
}
95
95
```
96
96
97
97
The response for the `authorize` call would be an object as below:
Copy file name to clipboardExpand all lines: docs/core-concepts/websocket/index.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ WebSocket is especially great for services that require continuous data exchange
25
25
To open a WebSocket connection, we need to create `new WebSocket` using the special protocol `ws`or `wss` in the url. Here is how you can do that in `JavaScript`:
26
26
27
27
```js
28
-
let socket =newWebSocket('wss://red.binaryws.com/websockets/v3?app_id=1089');
28
+
let socket =newWebSocket('wss://ws.binaryws.com/websockets/v3?app_id=1089');
29
29
```
30
30
31
31
:::caution
@@ -47,9 +47,9 @@ Sending a message can be done via socket.send(data).
47
47
48
48
Here’s an example in `JavaScript`:
49
49
50
-
```js
50
+
```js showLineNumbers
51
51
constapp_id=1089; // Replace with your app_id or leave as 1089 for testing.
@@ -72,13 +72,13 @@ Now, open the `index.html` file in our browser and check your developer console.
72
72
73
73
### Send and receive data
74
74
75
-
Our WebSocket server provides [ping/pong](/api-explorer#ping) functionality. Let's use it in our demo project to send and receive data. Change the event listeners for `open` and `message` as below:
75
+
Our WebSocket server provides <ahref="/api-explorer#ping"target="_blank"rel="noopener noreferrer">ping/pong</a> functionality. Let's use it in our demo project to send and receive data. Change the event listeners for `open` and `message` as below:
76
76
77
77
:::caution
78
78
The `send` function on the WebSocket connection, only receives `string`, `ArrayBuffer`, `Blob`, `TypedArray` and `DataView`. You can read more about them on [MDN](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send). This means, if we want to send an `object`, we have to stringify it with `JSON.stringify` first.
Copy file name to clipboardExpand all lines: docs/setting-up-a-deriv-application.md
+3-7Lines changed: 3 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,15 +14,11 @@ keywords:
14
14
description: How to setup Deriv application
15
15
---
16
16
17
-
:::danger
18
-
For the reviewer, Links in this section will be provided in the future.
19
-
:::
20
-
21
17
#### Deriv account
22
18
23
-
If you don't have a Deriv account yet, you can easily create one by visiting our signup page or using the [new_account_virtual](/api-explorer#new_account_virtual) API call. It's completely free. And if you have an account already, please log in using your account details. To avoid any accidental loss of funds during testing, we recommend using your demo account instead of a real account.
19
+
If you don't have a Deriv account yet, you can easily create one by visiting our signup page or using the <ahref="/api-explorer#new_account_virtual"target="_blank"rel="noopener noreferrer">new_account_virtual</a> API call. It's completely free. And if you have an account already, please log in using your account details. To avoid any accidental loss of funds during testing, we recommend using your demo account instead of a real account.
24
20
25
-
To earn markup, get a Deriv real account to receive your monthly earnings. You can also create a real account using [new_account_real](/api-explorer#new_account_real)or [new_account_maltainvest](/api-explorer#new_account_maltainvest) API calls.
21
+
To earn markup, get a Deriv real account to receive your monthly earnings. You can also create a real account using <ahref="/api-explorer#new_account_real"target="_blank"rel="noopener noreferrer">new_account_real</a> or <ahref="/api-explorer#new_account_maltainvest"target="_blank"rel="noopener noreferrer">new_account_maltainvest</a> API calls.
26
22
27
23
:::caution
28
24
To create Deriv applications, you'll need an API token with the Admin scope for the account you wish to use for your application.
@@ -38,7 +34,7 @@ To create a new API token, follow these steps:
38
34
2. Provide a name for your token
39
35
3. Click **Create**
40
36
41
-
Alternatively, you can create an API token via the [api_token](/api-explorer#api_token) API call.
37
+
Alternatively, you can create an API token via the <ahref="/api-explorer#api_token"target="_blank"rel="noopener noreferrer">api_token</a> API call.
42
38
43
39
:::caution
44
40
You need a token with the `Admin` scope to create an application.
0 commit comments