Skip to main content
All CollectionsIntegration Connection Guides
Setting Up Custom Source Integration
Setting Up Custom Source Integration
Tristan avatar
Written by Tristan
Updated over a week ago

Requirements

You will need to download the third-party app 'Postman', which is used to send API requests to our website in order to upload files from your computer.

Step 1: Create a 'New Connection'

In order to create a Custom Source connection, you will first need to navigate to the '/catalogue' webpage where you can add new integrations to your account. From here, click on 'View Integration' under the 'Custom Source'. You will then be taken to the settings menu for the 'Custom Uploader' integration you have just made. In the settings page you will be presented with the 'Client ID' and 'Client Secret'. You will need these later when setting up the Custom Source.

Step 2: Setting up Postman

Download and install 'Postman' from their download page. When opening the application you will be presented with their home page. Click on 'Workspaces' at the top of the page, and then 'Create Workspace' if you do not have one already. Fill out the Name and Summary for the new workspace you wish to create, select whether you wish for this to be a Personal, Team, or Public workspace, and then click on 'Create'. Then click on 'Go to Workspace'

Step 3: Sending the first API request to Medialake

Near the top of the page, click on the plus icon to create a new tab, similar to how you would create a new tab in 'Google Chrome'. Here you can start to edit the first API request will will send. Enter 'https://medialake.cloud/api/store-file' into the 'Enter URL or paste text' section near the top of the page. Then, to the left, click on the dropdown options next to 'GET' and select 'POST'. Below this section, start filing out the Key and Value section with the following information:

Key

Value

client_id

Your Client ID from the custom source settings page (required)

client_secret

Your Client secret from the custom source settings page (required)

name

Name of the file you wish to upload. Make sure to include the extension e.g image.jpg (required)

path

Path of the file you want to send (optional and only for your reference

Once you have filled out the keys and values as specified in the table above, click on the 'Send' button to send the API request to our website.

Step 4: Sending the file as a binary

A response from the website will then appear. A successful response will include a pre-signed URL, URL expiration, file key, and a callback endpoint. In the top right of the response, you should also get a '200 OK' as a status code, along with the time taken for the response and the total size of the payload. We will now use the information we just received from the website to send a file to the site for storage.

Create a new tab by clicking the plus button. Do not close your current tab as we want to save the information we got in the response. Copy and paste the 'presigned_url' from the previous response into the 'Enter URL or paste text' section of the new API request. Changed the request type to 'PUT' on the left next to the URL field

Do not include the quotation marks around the URL, or the comma afterwards.

Now, select the 'Body' tab above the table and then click on the 'Binary' checkbox. You will then be presented with the option to select a file from your computer. Attach the file, and then click on send. The keys and values in the 'Params' section should have filled out automatically with the information required. An empty response should be received, with the status code '200 OK' if successful.

Step 5: Confirming the file was received

Create a new tab to start a new API request. Enter 'https://medialake.cloud/api/store-file/callback' in the URL field and fill out the Parameter keys and values with the following information in the table below. Select the request method next to the URL as a 'POST method'

Key

Value

client_id

Your Client ID from the custom source settings page (required)

client_secret

Your Client secret from the custom source settings page (required)

status

'Success' or 'Fail', depending on if a 200 message was received in the previous step

file_key

This will have been returned in the first request we made. Please enter it here. Do not enter the quotations around it.

Once you have filled out the parameters with the information above, click on send. If your file has been successfully uploaded a '200 OK' status should be received.

Did this answer your question?