Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
protogrid:api_endpoints [2020-05-15 12:47] – [/api/v2/apps/<app_name>/<card_key>/attachments/<attachment_key>] 213.55.241.21protogrid:api_endpoints [2020-05-17 10:51] dru
Line 1: Line 1:
-S====== JSON API Endpoints ======+====== JSON API Endpoints ======
  
 This section lists the different API endpoints you can use to access or update Protogrid data. The respective http method is defined as [METHOD] following the endpoint in this documentation. This section lists the different API endpoints you can use to access or update Protogrid data. The respective http method is defined as [METHOD] following the endpoint in this documentation.
Line 301: Line 301:
 The code behind the attachment upload: The code behind the attachment upload:
 <code javascript> <code javascript>
-var HOST = "https://example.protogrid.com/api/v2/apps/example/attachments/"+var HOST = "https://example.protogrid.com/api/v2/apps/example/cards/some_card_key/attachments/"
 function uploadFile(file, progressCallback, successCallback) { function uploadFile(file, progressCallback, successCallback) {
   var key = createStorageKey(file)   var key = createStorageKey(file)
Line 307: Line 307:
   var xhr = new XMLHttpRequest()   var xhr = new XMLHttpRequest()
  
-  xhr.open("POST", HOST, true)+  xhr.open("POST", HOST+key, true)
  
   xhr.upload.addEventListener("progress", function(event) {   xhr.upload.addEventListener("progress", function(event) {
Print/export