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
+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
@@ -15,13 +15,14 @@ keywords:
15
15
- anatomy
16
16
description: Deriv API calls' anatomy
17
17
---
18
+
18
19
## Subscribe and send
19
20
20
21
All API calls have a send functionality for making a request and receiving a response. Certain API calls also offer a subscribe functionality allowing for updates to be sent to your application when new information becomes available.
21
22
22
23
### Subscribe
23
24
24
-
Several API calls provide the `subscribe` functionality. When you subscribe to an API call, you will receive a continuous stream of data of this particular API call.
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.
25
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
28
@@ -43,7 +44,6 @@ If you want to stop the message stream created by `subscribe`, you will have to
43
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
45
:::
45
46
46
-
47
47
## Request data
48
48
49
49
To make it easier for you to handle the request and response flow of your WebSocket connection, each Deriv WebSocket API call follows a standardised structure. You can use it for caching, validation, request, and response synchronisation.
@@ -84,7 +84,7 @@ Whatever you pass to this field will be returned back to you inside a `response`
84
84
85
85
#### The `req_id` field
86
86
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`.
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
90
To learn about additional optional fields specific to each API call, please refer to our [API Explorer](https://api.deriv.com/api-explorer).
Copy file name to clipboardExpand all lines: docs/core-concepts/authorization-authentication/index.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ keywords:
12
12
- deriv-authorisation
13
13
description: Deriv API authorisation and authentication
14
14
---
15
+
15
16
Without authorisation and authentication you'll only get access to roughly half of our API calls and features. For example, in order to buy contracts or utilise the `Copy Trading` features, your users must be authenticated and authorised by our **OAuth** provider and **WebSocket Server**.
16
17
17
18
## Before we start
@@ -20,12 +21,12 @@ Please make sure you have all the requirements mentioned below to continue.
20
21
21
22
### Requirements
22
23
23
-
1. Deriv account
24
+
1. Deriv account
24
25
2. Deriv API token with the appropriate access level
25
-
3. Deriv app ID
26
+
3. Deriv app ID
26
27
27
28
:::note
28
-
Please refer to [Setting up a Deriv application](docs/setting-up-a-deriv-application.md) for detailed instructions how to create a Deriv API token and application.
29
+
Please refer to [Setting up a Deriv application](docs/setting-up-a-deriv-application.md) for detailed instructions on how to create a Deriv API token and application.
29
30
:::
30
31
31
32
### API token
@@ -84,14 +85,17 @@ const user_accounts = [
84
85
},
85
86
];
86
87
```
87
-
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**:
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**:
90
+
88
91
```js
89
92
{
90
93
"authorize":"a1-f7pnteezo4jzhpxclctizt27hyeot"
91
94
}
92
95
```
93
96
94
97
The response for the `authorize` call would be an object as below:
98
+
95
99
```js
96
100
{
97
101
"account_list": [
@@ -145,4 +149,5 @@ The response for the `authorize` call would be an object as below:
145
149
"user_id":12345678
146
150
}
147
151
```
152
+
148
153
Now, the user is authorised, and you can use Deriv API calls on behalf of the account.
Copy file name to clipboardExpand all lines: docs/core-concepts/websocket/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
@@ -83,12 +83,12 @@ WebSockets are an essential client-server communication tool. To benefit the mos
83
83
84
84
Use WebSockets in the following cases:
85
85
86
-
1. When you're developing a real-time web application.
87
-
The most customary use of WebSocket is in real-time application development wherein it assists in a continual display of data at the client end. As the back-end server sends back this data continuously, a WebSocket allows uninterrupted pushing or transmitting of this data in the already open connection. The use of WebSockets makes such data transmission quick and leverages the application's performance.
88
-
2. For trading websites, such as Deriv.
89
-
Here, WebSocket assist in data handling that is impelled by the deployed back-end server to the client.
86
+
1. When you're developing a real-time web application.
87
+
The most customary use of WebSocket is in real-time application development wherein it assists in a continual display of data at the client end. As the back-end server sends back this data continuously, a WebSocket allows uninterrupted pushing or transmitting of this data in the already open connection. The use of WebSockets makes such data transmission quick and leverages the application's performance.
88
+
2. For trading websites, such as Deriv.
89
+
Here, WebSocket assists in data handling that is impelled by the deployed back-end server to the client.
90
90
3. When creating a chat application.
91
-
Chat application developers call out WebSockets for help in operations like a one-time exchange and publishing/broadcasting messages. As the same WebSocket connection is used for sending/receiving messages, communication becomes easy and quick.
91
+
Chat application developers call out WebSockets for help in operations like a one-time exchange and publishing/broadcasting messages. As the same WebSocket connection is used for sending/receiving messages, communication becomes easy and quick.
92
92
93
93
Now that we've established where WebSockets should be used, let's see where it is best to avoid them. This will help you steer clear of unnecessary operational hassles.
Copy file name to clipboardExpand all lines: docs/intro.md
+5-8Lines changed: 5 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,17 +6,13 @@ sidebar_label: Introduction
6
6
sidebar_position: 0
7
7
tags:
8
8
- introduction
9
-
- getting
10
-
- started
11
-
- quick
12
-
- start
9
+
- getting started
10
+
- quick startup
13
11
keywords:
14
12
- deriv
15
13
- api
16
-
- getting
17
-
- started
18
-
- quick
19
-
- start
14
+
- getting started
15
+
- quick startup
20
16
description: Getting started with Deriv API
21
17
---
22
18
@@ -49,4 +45,5 @@ When using our code examples, we also suggest to have a look at our [Languages](
49
45
If you want to know for example how you can `monetize your application` or how to create a `secure way for users to log in` to your application, then we provide a handful of [Guides](/docs/category/guides) that can assist you with that.
50
46
51
47
#### Setting up a Deriv application
48
+
52
49
If you want to know more about the essentials that are needed to setup your own application, then have a look at the [Setting up a Deriv application](/docs/setting-up-a-deriv-application) section.
0 commit comments