Replies: 1 comment
-
|
Hi,
However you should be able to do everything required. For example, to submit a cumulative period update, you would run something like $ mtd-cli seb cps-update <file> businessId taxYearWhere <file> is a JSON file with the format as described here.
Currently that is probably the best way. Using the endpoints[] array in libmtdac you can map the endpoint URL to an enum value that is used by the various endpoint files in mtd-cli. E.g. taking the above cumulative period update as an example We can see it has an endpoint URL of [MTD_API_EP_SEB_SECPS_AMEND] = {
.epstr = "MTD_API_EP_SEB_SECPS_AMEND",
.tmpl = "/individuals/business/self-employment/{nino}/{businessId}/cumulative/{taxYear}",
.method = M_PUT,
.ctype = CONTENT_TYPE_JSON,
.api = MTD_EP_API_SEB,
},Taking the enum value {
.name = "cps-update",
.api_ep = MTD_API_EP_SEB_SECPS_AMEND,
.nr_req_args = 3,
.file_data = true,
.args = "<file> businessId taxYear"
}, {So that shows the endpoint sub-command and required arguments. Near the top of the file is #define API sebThat's the name of the endpoint, so we end up with $ mtd-cli seb cps-update <file> businessId taxYearNow the idea would be to wrap this up in a shell script once you know all the bits you need for your use case. Oh and in case you didn't notice there is bash command completion support, simply |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Thanks for writing mtd-cli and libmtdac and making them available.
I thought it might be useful to other users of devuan-linux (and possibly debian) to have example commands to get started. In my case, for things like this i prefer using
LD_PRELOADto installing in/usr/, so:(On devuan,
DBUS_SESSION_BUS_ADDRESS=unix:path=/var/run/dbus/system_bus_socketseems to be required in order formtd-cli init itsato (i think) communicate with the web browser.)I struggled a little with what to do after this. What seemed to work is:
Follow instructions in libmtdac/README.rst
Register with HMRC.Run:
mtd-cli/src/mtd-cli init itsa.For
Enter your NINO, enter your National insurance number. I've subsequently read about this in the readme, but it confused me for a while.Enter test user user id/pasword.
It's probably me, but i got confused by this:
I didn't realise that i had to press ENTER first - i thought mtd-cli had tried and failed to open a web browser, so i opened the URL manually.
I'm not sure how i could use mtd-cli to actually create records and send quarterly updates etc. Is there any information about what mtd-cli commands to use? Or should i look at the gov.uk website's description of the REST API and attempt to map back to mtd-cli commands?
Thanks for any help and suggestions.
Beta Was this translation helpful? Give feedback.
All reactions