Skip to main content
PATCH
/
api
/
v1
/
campuses
/
{id}
Update a campus
curl --request PATCH \
  --url https://api.scholarlysoftware.com/api/v1/campuses/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/vnd.api+json' \
  --data '
{
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "type": "campus",
    "attributes": {
      "name": "Main Campus",
      "external_id": "CAMPUS-001"
    },
    "relationships": {}
  }
}
'
import requests

url = "https://api.scholarlysoftware.com/api/v1/campuses/{id}"

payload = { "data": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "type": "campus",
        "attributes": {
            "name": "Main Campus",
            "external_id": "CAMPUS-001"
        },
        "relationships": {}
    } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/vnd.api+json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
  body: JSON.stringify({
    data: {
      id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
      type: 'campus',
      attributes: {name: 'Main Campus', external_id: 'CAMPUS-001'},
      relationships: {}
    }
  })
};

fetch('https://api.scholarlysoftware.com/api/v1/campuses/{id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "type": "campus",
    "attributes": {
      "created_at": "<string>",
      "updated_at": "<string>",
      "name": "Main Campus",
      "external_id": "CAMPUS-001"
    },
    "relationships": {}
  }
}
{
  "errors": [
    {
      "status": "<string>",
      "title": "<string>",
      "detail": "<string>"
    }
  ]
}
{
  "errors": [
    {
      "status": "<string>",
      "title": "<string>",
      "detail": "<string>"
    }
  ]
}
{
  "errors": [
    {
      "status": "<string>",
      "title": "<string>",
      "detail": "<string>"
    }
  ]
}
{
  "errors": [
    {
      "status": "422",
      "title": "Validation Error",
      "detail": "Label can't be blank"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Authorization
string
required

Bearer token

Path Parameters

id
string
required

Body

application/vnd.api+json
data
object
required

Response

campus updated

data
object
required