Add API documentation to GUIDE.md
This commit is contained in:
		
							parent
							
								
									ba91ed561d
								
							
						
					
					
						commit
						6d84f63130
					
				
							
								
								
									
										19
									
								
								GUIDE.md
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								GUIDE.md
									
									
									
									
									
								
							@ -208,6 +208,25 @@ In a single-page application, the page never reloads. (That's the entire point o
 | 
			
		||||
 | 
			
		||||
Fortunately, Shynet offers a simple method you can call from anywhere within your JavaScript to indicate that a new page has been loaded: `Shynet.newPageLoad()`. Add this method call to the code that handles routing in your app, and you'll be ready to go.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### API
 | 
			
		||||
 | 
			
		||||
All data displayed on dashboard can be obtained via API on url ```//shynet.example.com/api/dashboard/```.
 | 
			
		||||
By default this url return full data from all services from last 30 days.
 | 
			
		||||
Authentication header should be set to use user's parsonal API token (```'Authorization:Token <user API token>'```).
 | 
			
		||||
 | 
			
		||||
There are 4 optional query parameters:
 | 
			
		||||
 * uuid - to get data only from one service
 | 
			
		||||
 * startDate - to set start date in format YYYY-MM-DD
 | 
			
		||||
 * endDate - to set end date in format YYYY-MM-DD
 | 
			
		||||
 * basic - to get only basic data set to '1' or 'true'
 | 
			
		||||
 | 
			
		||||
Example in HTTPie:
 | 
			
		||||
```http get '//shynet.example.com/api/dashboard/?uuid={{service_uuid}}&startDate=2021-01-01&endDate=2050-01-01&basic=1' 'Authorization:Token {{user_api_token}}'```
 | 
			
		||||
 | 
			
		||||
Example in cURL:
 | 
			
		||||
```curl -H 'Authorization:Token {{user_api_token}}' '//shynet.example.com/api/dashboard/?uuid={{service_uuid}}&startDate=2021-01-01&endDate=2050-01-01&basic=1'```
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## Troubleshooting
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user