OpenAPI Specification
openapi: 3.0.1
info:
title: Marketo Engage Rest Approve Files API
description: Marketo exposes a REST API which allows for remote execution of many of the systems capabilities. From creating programs to bulk lead import, there are many options which allow fine-grained control of a Marketo instance.
termsOfService: https://www.adobe.com/legal.html
contact:
name: Adobe Developer Relations
url: https://experienceleague.adobe.com/en/docs/marketo-developer/marketo/home
email: developerfeedback@marketo.com
license:
name: API License Agreement
url: https://experienceleague.adobe.com/en/docs/marketo-developer/marketo/api-license
version: '1.0'
servers:
- url: https://localhost:8080/
tags:
- name: Files
description: File Controller
paths:
/rest/asset/v1/file/byName.json:
get:
tags:
- Files
summary: Marketo Get File by Name
description: 'Returns files records for the given name. Required Permissions: Read-Only Assets, Read-Write Assets'
operationId: getFileByNameUsingGET
parameters:
- name: name
in: query
description: Name of the file
required: true
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseOfFileResponse'
/rest/asset/v1/file/{id}.json:
get:
tags:
- Files
summary: Marketo Get File by Id
description: 'Returns the file record for the given id. Required Permissions: Read-Only Assets, Read-Write Assets'
operationId: getFileByIdUsingGET
parameters:
- name: id
in: path
description: Id for file in database
required: true
schema:
type: integer
format: int32
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseOfFileResponse'
/rest/asset/v1/files.json:
get:
tags:
- Files
summary: Marketo Get Files
description: 'Returns the files from the given folder. Required Permissions: Read-Only Assets, Read-Write Assets'
operationId: getFilesUsingGET
parameters:
- name: folder
in: query
description: JSON representation of parent folder, with members 'id', and 'type' which may be 'Folder' or 'Program'
schema:
type: string
- name: offset
in: query
description: Integer offset for paging. Default 0
schema:
type: integer
format: int32
- name: maxReturn
in: query
description: Maximum number of files to return. Max 200, default 20
schema:
type: integer
format: int32
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseOfFileResponse'
post:
tags:
- Files
summary: Marketo Create File
description: 'Creates a new file from the included payload. Required Permissions: Read-Write Assets'
operationId: createFileUsingPOST
requestBody:
description: createFileRequest
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/CreateFileRequest'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseOfFileResponse'
x-codegen-request-body-name: createFileRequest
components:
schemas:
Folder:
required:
- id
- type
type: object
properties:
id:
type: integer
description: Id of the folder
format: int32
type:
type: string
description: Type of folder
enum:
- Folder
- Program
description: JSON representation of a folder
ResponseOfFileResponse:
type: object
properties:
errors:
type: array
items:
$ref: '#/components/schemas/Error'
requestId:
type: string
result:
type: array
items:
$ref: '#/components/schemas/FileResponse'
success:
type: boolean
warnings:
type: array
items:
type: string
CreateFileRequest:
required:
- file
- folder
- name
type: object
properties:
description:
type: string
description: Description of the asset
file:
type: string
description: Multipart file. Content of the file.
folder:
$ref: '#/components/schemas/Folder'
insertOnly:
type: boolean
description: Whether the calls hould fail if there is already an existing file with the same name
name:
type: string
description: Name of the File
FileFolder:
type: object
properties:
id:
type: integer
format: int32
name:
type: string
type:
type: string
FileResponse:
required:
- createdAt
- folder
- id
- mimeType
- name
- size
- updatedAt
- url
type: object
properties:
createdAt:
type: string
description: Datetime when the file was created
format: date-time
description:
type: string
description: Description of the file
folder:
$ref: '#/components/schemas/FileFolder'
id:
type: integer
description: Id of the file
format: int32
mimeType:
type: string
description: MIME type of the file
name:
type: string
description: Name of the file
size:
type: integer
description: Size of the file in bytes
format: int32
updatedAt:
type: string
description: Datetime when the file was most recently updated
format: date-time
url:
type: string
description: Publically accessible URL of the file
Error:
required:
- code
- message
type: object
properties:
code:
type: string
description: Error code of the error. See full list of error codes <a href="https://developers.marketo.com/rest-api/error-codes/">here</a>
message:
type: string
description: Message describing the cause of the error
x-original-swagger-version: '2.0'