Hi @CaptainJack, You’re encountering an issue with the Workspace API in Databricks.
The error message you received, “Could not parse request object: Failed to Decode VALUE_STRING as base 64,” indicates an issue with the data you’re sending.
Let’s break down the problem and find a solution:
Base64 Encoding:
- Base64 encoding is commonly used to represent binary data (such as files or images) as text. When working with APIs, especially those that handle file content, you might need to encode or decode data as base64.
- In your case, it appears that the content you’re sending (Databricks Notebooks) needs to be encoded in base64 format.
Payload Structure:
- Your payload includes several parameters, such as path, format, language, content, and overwrite.
- The critical part here is the content field, which should contain the base64-encoded content of your Databricks Notebooks.
Solution:
Before sending the payload, ensure that the content of your notebooks is correctly encoded in base64.
You can use Python’s base64 module to encode your notebook content.
API Endpoint:
- Ensure that the API variable you’re using (/API/2.0/workspace/import) corresponds to the correct API endpoint for importing notebooks.
Remember to replace the file path (/Workspace/Source/Program) with the actual path to your Databricks Notebooks. If you follow these steps, your notebooks should be successfully imported using the Workspace API.
Feel free to ask if you need further assistance! 😊