Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Trello API Post broken

Mark Warburton September 9, 2020

Hi people,

I can use the API project key and user token to view cards in trello. Up until recently, I could also post files onto those trello cards. Is the API partially broken at the moment or has something changed?

The error I now receive (in myJson.response) is: 

  <Response [404]>

I recreated my token and ensured it was marked for read and write permissions. From the 404 error, it appears to be a permissions issue, but the card being written to is newly created and using the same account tied to that token.

Any other ideas?

Thanks

Regards

Mark

 

Here is my python function:

def addCardAttachment(trelloKey, trelloToken,filePath,cardId):

  import requests

  import json

  url = f"https://api.trello.com//1/cards/{cardId}/attachments"

  headers = {
    "Accept": "application/json"
  }

  query = {
    'key' : trelloKey,
    'token' : trelloToken,
  }

  files = {
    'file': open(filePath, 'rb'),
  }

  response = requests.request(
    "POST",
    url,
    headers=headers,
    params=query,
    files=files
  )


  myJson = json.loads(response.text)
return myJson

 

2 answers

2 accepted

0 votes
Answer accepted
Mark Warburton September 9, 2020

@Iain Dooley Thanks. I'll do that.

0 votes
Answer accepted
Iain Dooley
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 9, 2020

@Mark Warburton you'll probably have more luck asking this question on the developer community:

https://community.developer.atlassian.com/

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events