Import documents from a connected provider (e.g. Google Drive)
const url = 'https://api.yggy.tech/api/v1/documents/import-from-provider';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"type":"jira","fileIds":["example"],"projectId":"example","parentNoteId":"example","desiredTier":"auto","importTotal":680,"importId":"imp_3f9c2a7d1e8b4c6a9f0e2d4b6a8c0e1f"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.yggy.tech/api/v1/documents/import-from-provider \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "type": "jira", "fileIds": [ "example" ], "projectId": "example", "parentNoteId": "example", "desiredTier": "auto", "importTotal": 680, "importId": "imp_3f9c2a7d1e8b4c6a9f0e2d4b6a8c0e1f" }'Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
First request of an import sent in several requests: how many files were selected in all. When the monthly credit limit is not reached yet, the response returns an importId, and the selected files, at most one month’s credits, are processed even if the limit is reached while the import runs. Files past that are refused with usage_limit_exceeded.
Example
680Later requests of the same import: the importId the first response returned. An unknown or expired id is ignored and the monthly credit limit applies as usual; once the import’s files are used up, the rest is refused with usage_limit_exceeded.
Example
imp_3f9c2a7d1e8b4c6a9f0e2d4b6a8c0e1fResponses
Section titled “ Responses ”One entry per fileId: either queued (documentId) or failed (error)
object
object
For an email: what became of each of its attachments. Each real attachment is imported as a document of its own; small images, inline pictures, calendar invites and files that cannot be imported are skipped with a reason.
object
Set unless the attachment was skipped.
Why a skipped attachment was left out.
Set when the request belongs to an admitted import. Send it as importId with the next requests of this import.
Example
{ "documents": [ { "attachments": [ { "status": "imported", "reason": "inline" } ] } ]}Not authenticated
No active organization
Provider type has no content-browsing capability
No connected row for this provider/caller
Too many imports into notes by this user