matheusdelecrode | Posts: 12

Erro na requisição: 405 Client Error: Method Not Allowed

0 votes

Hi, I am sending the following request:

import requests


def generate_embedded_signing_url(api_key, package_id, instance_url):
roleId="63f942c0-8c00-4733-8c96-8275b9100555"
url = f"{instance_url}/api/packages/{package_id}/roles/{roleId}/signingUrl"

headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": f"Basic {api_key}"
}

payload = {
"roleId": roleId,
"packageId": package_id,
"url": "https://sandbox.esignlive.com/auth?senderAuthenticationToken"
"=MjE5YjAyZDktM2VkZC00ODAwLWExMjItZjYxMzEwOTU3ZDAx&target=https://sandbox.esignlive.com/a/transaction"
"/yX2hKk8CIZPmyWHpv3PaHD0g0rY=/designer"
}

http_proxy = "http://proxybl.net.bradesco.com.br:80"
https_proxy = "http://proxybl.net.bradesco.com.br:80"

proxies = {
"http": http_proxy,
"https": https_proxy
}

try:
response = requests.post(url, headers=headers, proxies=proxies)
response.raise_for_status() # Verifica se a resposta foi bem-sucedida (status 2xx)
data = response.json()
print(response)
return data
except requests.exceptions.RequestException as e:
print("Erro na requisição:", e)
return None

api_key = "api key"
package_id = "id_package"
instance_url = "https://sandbox.esignlive.com"
signing_url = generate_embedded_signing_url(api_key, package_id, instance_url)
if signing_url:
print("URL da Cerimônia de Assinatura Incorporada:", signing_url)
else:
print("Falha ao gerar o URL da Cerimônia de Assinatura Incorporada.")

However, I am getting the return: Request error: 405 Client Error: Method Not Allowed
 

can you help me?


Approved Answer
Duo_Liang | Posts: 3776

Reply to: Erro na requisição: 405 Client Error: Method Not Allowed

0 votes

Hi Matheus,

 

In order to get the signing url, try with a GET call without payload, like below:

GET https://sandbox.esignlive.com/api/packages/J5OSoVfF6ANT27FuVyRmHl5BbCc=/roles/7301b690-0988-44f0-80c4-dd0059867cb7/signingUrl

 

Duo


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off