Context Sources
Create a source
Changed onCreate a source that can be attached to a CONTEXT_SOURCE_LIST attribute on a Product (for example the universal Images attribute).
Submit as multipart/form-data. The type form field discriminates the payload carried on value: for FILE, send the file bytes as the value multipart part; for TEXT, URL, and KNOWLEDGE, send the payload as the value form field.
Take the id from the response and include it in the attribute value on a subsequent POST /v1/products or PATCH /v1/products/{productId} call. Attributes currently accept FILE sources only, and may narrow that further — the Images attribute takes PNG and JPEG — so a source created here is rejected at attach time if it does not qualify.
post/v1/context-sources
Request
- Base URLhttps://api.jasper.ai
- URLhttps://api.jasper.ai/v1/context-sources
- Auth
- API key in header X-API-Key
- or OAuth 2Authorization code: https://api.jasper.ai/oauth2/authorizeToken URL: https://api.jasper.ai/oauth2/token scopes: user
Request body multipart/form-data
Example request
{
"type": "FILE"
}Response
Source created successfully.
Example response
{
"requestId": "8393f82b3f6a4f6e8a405777b9305254",
"resource": "knowledge",
"data": {
"id": "csc_2ee766eaa4ef48e59da1d9602bfecf2d",
"name": "widget-front.png",
"type": "FILE",
"value": "https://example.com/product"
}
}Changes
- info
endpoint added
- info