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

Add support for the undocumented user/%s/monetary-account/%s/customer-statement/%s/content call #147

Closed
karstennilsen opened this issue May 24, 2018 · 6 comments

Comments

@karstennilsen
Copy link

You can get all the information of a customer statement, but you can't actually download the customer statement.
Please add a content() function in CustomerStatementExport.php.

For now I added for myself:
/**
* @param int $customerStatementExportId
* @param int|null $monetaryAccountId
* @param string[] $customHeaders
*
* @return BunqResponseCustomerStatementExport
*/
public static function content(
int $customerStatementExportId,
int $monetaryAccountId = null,
array $customHeaders = []
) {
$apiClient = new ApiClient(static::getApiContext());
$responseRaw = $apiClient->get(
vsprintf(
self::ENDPOINT_URL_READ . '/content',
[
static::determineUserId(),
static::determineMonetaryAccountId($monetaryAccountId),
$customerStatementExportId,
]
),
[],
$customHeaders
);

    return (string) $responseRaw->getBodyString();
}
@OGKevin
Copy link
Contributor

OGKevin commented May 24, 2018

I think this is what you are looking for ?

/**
* Fetch the raw content of a statement export. The returned file format
* could be MT940, CSV or PDF depending on the statement format specified
* during the statement creation. The doc won't display the response of a
* request to get the content of a statement export.
*
* @generated
*/
class CustomerStatementExportContent extends BunqModel

@karstennilsen
Copy link
Author

Yes, couldn't find that 👍
Issues solved!
By the way, this call is not at all mentioned on doc.bunq.com, doesn't make stuff easier...

@OGKevin
Copy link
Contributor

OGKevin commented May 24, 2018

@karstennilsen i dont understand ? Its listed as the second endpoint under https://doc.bunq.com/#tag/content

@karstennilsen
Copy link
Author

Lol, ok this proves your manual is impossible to read :) You expect this in the customer-statement category.
Maybe in each case add a mention in the customer-statement response 200 like you did in the year export.

@OGKevin
Copy link
Contributor

OGKevin commented May 24, 2018

the doc is categorized on endpoints. This falls under the /content endpoint.

@karstennilsen
Copy link
Author

Totally fine. The only point I'm trying to make is that I as quite experienced developer couldn't find it.
I even gave a suggestion (which is e.g. already done in the export-anual-overview) so people like me (your dev customers) understand your API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants