Parchment Docs

Sharing

Sharing and invitations

Get all outgoing shares

GET
/sharing/outgoing

Response Body

curl -X GET "https://example.com/sharing/outgoing"
fetch("https://example.com/sharing/outgoing")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://example.com/sharing/outgoing"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/sharing/outgoing"

response = requests.request("GET", url)

print(response.text)
Empty

Get shares for a resource

GET
/sharing/outgoing/{resourceType}/{resourceId}

Path Parameters

resourceTypeRequiredstring
resourceIdRequiredstring

Response Body

curl -X GET "https://example.com/sharing/outgoing/string/string"
fetch("https://example.com/sharing/outgoing/string/string")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://example.com/sharing/outgoing/string/string"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/sharing/outgoing/string/string"

response = requests.request("GET", url)

print(response.text)
Empty

Share a resource with a friend

POST
/sharing

Request Body

application/jsonRequired
recipientHandleRequiredstring
resourceTypeRequiredstring
resourceIdRequiredstring
encryptedDatastring
noncestring

Response Body

curl -X POST "https://example.com/sharing/" \
  -H "Content-Type: application/json" \
  -d '{
    "recipientHandle": "string",
    "resourceType": "collection",
    "resourceId": "string",
    "encryptedData": "string",
    "nonce": "string"
  }'
const body = JSON.stringify({
  "recipientHandle": "string",
  "resourceType": "collection",
  "resourceId": "string",
  "encryptedData": "string",
  "nonce": "string"
})

fetch("https://example.com/sharing/", {
  body
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "strings"
)

func main() {
  url := "https://example.com/sharing/"
  body := strings.NewReader(`{
    "recipientHandle": "string",
    "resourceType": "collection",
    "resourceId": "string",
    "encryptedData": "string",
    "nonce": "string"
  }`)
  req, _ := http.NewRequest("POST", url, body)
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/sharing/"
body = {
  "recipientHandle": "string",
  "resourceType": "collection",
  "resourceId": "string",
  "encryptedData": "string",
  "nonce": "string"
}
response = requests.request("POST", url, json = body, headers = {
  "Content-Type": "application/json"
})

print(response.text)
Empty

Revoke a share

POST
/sharing/{shareId}/revoke

Path Parameters

shareIdRequiredstring

Response Body

curl -X POST "https://example.com/sharing/string/revoke"
fetch("https://example.com/sharing/string/revoke")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://example.com/sharing/string/revoke"

  req, _ := http.NewRequest("POST", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/sharing/string/revoke"

response = requests.request("POST", url)

print(response.text)
Empty

Delete a share

DELETE
/sharing/{shareId}

Path Parameters

shareIdRequiredstring

Response Body

curl -X DELETE "https://example.com/sharing/string"
fetch("https://example.com/sharing/string")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://example.com/sharing/string"

  req, _ := http.NewRequest("DELETE", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/sharing/string"

response = requests.request("DELETE", url)

print(response.text)
Empty

Get all incoming shares

GET
/sharing/incoming

Response Body

curl -X GET "https://example.com/sharing/incoming"
fetch("https://example.com/sharing/incoming")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://example.com/sharing/incoming"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/sharing/incoming"

response = requests.request("GET", url)

print(response.text)
Empty

Get pending incoming shares

GET
/sharing/incoming/pending

Response Body

curl -X GET "https://example.com/sharing/incoming/pending"
fetch("https://example.com/sharing/incoming/pending")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://example.com/sharing/incoming/pending"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/sharing/incoming/pending"

response = requests.request("GET", url)

print(response.text)
Empty

Accept an incoming share

POST
/sharing/incoming/{shareId}/accept

Path Parameters

shareIdRequiredstring

Response Body

curl -X POST "https://example.com/sharing/incoming/string/accept"
fetch("https://example.com/sharing/incoming/string/accept")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://example.com/sharing/incoming/string/accept"

  req, _ := http.NewRequest("POST", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/sharing/incoming/string/accept"

response = requests.request("POST", url)

print(response.text)
Empty

Reject an incoming share

POST
/sharing/incoming/{shareId}/reject

Path Parameters

shareIdRequiredstring

Response Body

curl -X POST "https://example.com/sharing/incoming/string/reject"
fetch("https://example.com/sharing/incoming/string/reject")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://example.com/sharing/incoming/string/reject"

  req, _ := http.NewRequest("POST", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/sharing/incoming/string/reject"

response = requests.request("POST", url)

print(response.text)
Empty

Delete an incoming share

DELETE
/sharing/incoming/{shareId}

Path Parameters

shareIdRequiredstring

Response Body

curl -X DELETE "https://example.com/sharing/incoming/string"
fetch("https://example.com/sharing/incoming/string")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://example.com/sharing/incoming/string"

  req, _ := http.NewRequest("DELETE", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/sharing/incoming/string"

response = requests.request("DELETE", url)

print(response.text)
Empty