POST
/
api
/
v1
/
materials
/
upload
/
url
Upload material from URL
const url = 'https://studyfetchapi.com/api/v1/materials/upload/url';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: '{"url":"<string>","name":"<string>","folderId":"<string>"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
{
  "_id": "<string>",
  "name": "<string>",
  "organizationId": "<string>",
  "folderId": "<string>",
  "contentType": "text",
  "content": {
    "text": "<string>",
    "url": "<string>",
    "s3Key": "<string>",
    "s3Url": "<string>",
    "filename": "<string>",
    "fileSize": 123,
    "mimeType": "<string>"
  },
  "metadata": {},
  "status": "active",
  "usage": {},
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

x-api-key
string
header
required

API Key for authentication

Body

application/json

Response

201 - application/json

Material uploaded from URL successfully

The response is of type object.