Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: attachment API returns only TransactionJournalId #2752

Closed
michael-v2vlc opened this issue Oct 20, 2019 · 1 comment
Closed

API: attachment API returns only TransactionJournalId #2752

michael-v2vlc opened this issue Oct 20, 2019 · 1 comment
Labels
enhancement Requests for enhancements of existing stuff. fixed Bugs that are fixed (in a coming release).

Comments

@michael-v2vlc
Copy link

I am running Firefly III version 4.8.1.4

Description
Endpoints for attachments return only TransactionJournalId. With this ID, I am not able to find original transaction (endpoint /api/v1/transactions/{id} works only with transaction group ID).

/api/v1/attachments/
/api/v1/attachments/{id}

{
  "data": {
    "type": "attachments",
    "id": "1",
    "attributes": {
      "created_at": "2019-10-20T14:00:28+02:00",
      "updated_at": "2019-10-20T14:00:28+02:00",
      "attachable_id": 1,
      "attachable_type": "TransactionJournal",
      "md5": "d5cfead94f5350c12c322b5b664544c1",
      "filename": "empty-file.txt",
      "download_uri": "https://demo.firefly-iii.org/api/v1/attachments/1/download",
      "upload_uri": "https://demo.firefly-iii.org/api/v1/attachments/1/upload",
      "title": "Empty file (title)",
      "notes": null,
      "mime": "text/plain",
      "size": 0
    },
    "links": {
      "0": {
        "rel": "self",
        "uri": "/attachment/1"
      },
      "self": "https://demo.firefly-iii.org/api/v1/attachments/1"
    }
  }
}

Since API for attachments is generic (attachments can be added to bill and import job (whatever that is)), it might be difficult to fix this issue without breaking this aspect of the API.

@JC5
Copy link
Member

JC5 commented Oct 20, 2019

That's true, and unfortunately I can't fix this. But a new endpoint in the next release will allow you to request a transaction by one of its journals: api/v1/journals/x.

Will go live, with documentation in the next release.

@JC5 JC5 added enhancement Requests for enhancements of existing stuff. fixed Bugs that are fixed (in a coming release). labels Oct 20, 2019
@JC5 JC5 closed this as completed in 50d3c36 Oct 21, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests for enhancements of existing stuff. fixed Bugs that are fixed (in a coming release).
Projects
None yet
Development

No branches or pull requests

2 participants