Hello @Eric Dallaire ,
It seems the connector always taking the value from Image URL field, that may be the reason you getting The parameter urlSource or base64Source is required.
when setting Image URL to blank and gives it should be http or https
when setting Image URL other than http urls.
So, i found workaround that you create a python script which makes POST request and returns job URL, next run this script from PAD using command session.
Below is the python script
import requests
import base64
import json
import time
def execute(data):
headers = {"Ocp-Apim-Subscription-Key": "key"}
body = {"base64Source":data}
res = requests.post("https://eastus.api.cognitive.microsoft.com/documentintelligence/documentModels/prebuilt-invoice:analyze?_overload=analyzeDocument&api-version=2024-11-30",headers=headers,data=json.dumps(body))
if res.status_code == 202:
return res.headers['Operation-Location']
else:
return res.content
def file_to_base64(filepath):
with open(filepath, "rb") as file:
base64_encoded = base64.b64encode(file.read()).decode("utf-8")
return base64_encoded
file_path = r"Your_local_file_path\goals.pdf" # Replace with your file path
base64_source = file_to_base64(file_path)
print(execute(base64_source))
It's not that you need to use python only you can use any familiar language where you can run it using command.
And below is the flow you need make.
- In Open CMD session you give path to your script file folder.
- In Write to CMD session give the command
- Wait for few seconds.
- Then you Read from CMD session
Output :
After the running the flow you will get output in CmdOutput.
You can alter the script further to retrieve results from above URL, according to your requirement you change the script.
Let me know if you have any query.
Thank you