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
Copy file name to clipboardExpand all lines: README.md
+3-2
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
-
## SimplyPrint API documentation
2
-
**Link to the API documentation;**https://apidocs.simplyprint.io/
1
+
# SimplyPrint API documentation
2
+
3
+
**Link to the API documentation;**<https://apidocs.simplyprint.io/>
3
4
4
5
This repository contains the entire SimplyPrint API documentation, all content is located in `/source/index.html.md` - edits or contributions are welcome.
This means this site contains no real documentation yet, but it will soon.
34
+
</aside>
35
+
36
+
Welcome to the **SimplyPrint API**!
37
+
38
+
This documentation goes through authenticating and how to use the API. To get started you'll need an API key.
39
+
40
+
## Getting an API key
41
+
42
+
To get an API key you'll need a SimplyPrint account that is either a member of an organization or has at least the [SimplyPrint Pro plan](https://simplyprint.io/#pricing).
43
+
44
+
To create your own API key you first need a SimplyPrint account, you can go to your [account settings](https://simplyprint.io/account/settings) and create a new API key.
45
+
46
+
TODO; Create API key page and explain how to create an API key.
47
+
48
+
## The base URL
49
+
50
+
The base URL for the SimplyPrint API is `https://api.simplyprint.io/{id}/`.
51
+
52
+
To use the base API at <https://api.simplyprint.io>, you will need to specify an id.
53
+
54
+
The id represents the unique identifier for the company that you are using the API key for. This id is used to access the specific functionality within the API that is associated with the company.
55
+
56
+
The endpoint represents the specific functionality that you want to access within the API. There are various endpoints available, each with its own specific purpose and functionality.
57
+
58
+
For example, if you want to access the `account/Test` endpoint for a company with an id of 123, you would use the following API endpoint:
59
+
60
+
<https://api.simplyprint.io/123/account/Test>
61
+
62
+
If you are part of an organization, you might need to ask your organization administrator to allow API access for your account for the organization.
27
63
28
-
**The SimplyPrint API is under construction!**
29
-
This means this site contains no real documentation yet, but it will soon.
64
+
<asideclass="notice">
65
+
<b>For the rest of this documentation, we will use the following variables:</b>
30
66
67
+
<ol>
68
+
<li>Replace <code>{base_url}</code> with your base api url</li>
69
+
<li>Replace <code>{API_KEY}</code> with your API key</li>
70
+
</ol>
71
+
</aside>
31
72
32
-
#Authentication
73
+
## Test your API key
33
74
34
-
> To authorize, use this code:
75
+
```shell
76
+
curl {base_url}/account/Test \
77
+
--header 'X-API-KEY: {API_KEY}'
78
+
```
79
+
80
+
```python
81
+
import requests
82
+
83
+
url ="{base_url}/account/Test"
35
84
36
-
```php
37
-
<?php
38
-
//Coming soon...
39
-
?>
85
+
r = requests.get(url, headers={'X-API-KEY': '{API_KEY}'})
86
+
87
+
print(r.json())
40
88
```
41
89
42
-
Coming soon...
90
+
> Success return:
91
+
92
+
```json
93
+
{
94
+
"status": true,
95
+
"message": "Your API key is valid!"
96
+
}
97
+
```
98
+
99
+
> Error return in case of an invalid or missing API key:
100
+
101
+
```json
102
+
{
103
+
"status": false,
104
+
"message": "No API key provided, or not logged in"
105
+
}
106
+
```
107
+
108
+
> Error return in case of missing permissions for the organization:
109
+
110
+
```json
111
+
{
112
+
"status": false,
113
+
"message": "You don't have access to this account"
114
+
}
115
+
```
116
+
117
+
To verify that your API key is valid and that you have access to the desired organization, you can make a request to the `/account/Test` endpoint.
118
+
119
+
To make any request to the SimplyPrint API, you will need to include your API key in the request header. You can do this by including the `X-API-KEY` header in your request. On the right side of this page, you can see an example of how to make a request to the `/account/Test` endpoint using cURL and Python.
120
+
121
+
If you are unable to successfully make a request to the `/account/Test` endpoint using the provided example, there may be a few possible issues:
122
+
123
+
- Your API key may be invalid or missing. Make sure that you have a valid API key and that you are including it in the request header as shown in the example.
124
+
- You may not have access to the organization specified in the `id` parameter. Make sure that you are using the correct `id` for the organization that you have access to.
125
+
- There may be a problem with the base API URL or endpoint. Double check that you are using the correct base API URL and endpoint in your request.
126
+
127
+
If you are unable to resolve the issue after troubleshooting these potential issues, you may need to contact your organization administrator for further assistance. Otherwise, feel free to contact us via our [helpdesk](https://help.simplyprint.io/).
0 commit comments