Since it is always a good idea to implement your own way of sharing data (sarcasm mode) the people of
https://www.acv-groep.nl/ decided to stop with submitting their data to afvalwijzer.nl and implement their own application.
They are now using
http://www.acv-afvalkalender.nl/ which produces a lot of Json garbage.
First you need to submit a request as follows:
Code: Select all
curl 'https://wasteapi.2go-mobile.com/api/FetchAdress' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: nl,en-US;q=0.7,en;q=0.3' --compressed -H 'Referer: https://wasteapi.2go-mobile.com' -H 'Content-Type: application/json;charset=utf-8' -H 'Origin: https://afvalportaal.2go-mobile.com' -H 'Connection: keep-alive' -H 'TE: Trailers' --data '{"postCode":"6711DD","houseNumber":"4","companyCode":"f8e2844a-095e-48f9-9f98-71fceb51d2c3"}'
This results in receiving address information and unique id:
Code: Select all
{"userMessage":{"type":null,"messageCode":0,"description":null},"ExtraOption":{"$type":"System.Dynamic.ExpandoObject, System.Core"},"dataList":[{"UniqueId":"698629","Street":"Bergstraat","HouseNumber":"4","HouseLetter":"","HouseNumberIndication":null,"HouseNumberAddition":"","ZipCode":"6711DD","City":"EDE GLD","Community":"EDE","AddressType":"","Floor":null,"AddressUniqueId":0,"AddressUnique":null}],"intDataList":null,"data":null,"status":true,"messageCode":107,"token":null,"pdfResponse":null,"ID":null,"invalidParameters":null,"total":0,"messageToString":null}
This information can be used to send another request to receive the pickup date list as follows:
Code: Select all
curl 'https://wasteapi.2go-mobile.com/api/GetCalendar' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: nl,en-US;q=0.7,en;q=0.3' --compressed -H 'Referer: https://wasteapi.2go-mobile.com' -H 'Content-Type: application/json;charset=utf-8' -H 'Origin: https://afvalportaal.2go-mobile.com' -H 'Connection: keep-alive' -H 'TE: Trailers' --data '{"companyCode":"f8e2844a-095e-48f9-9f98-71fceb51d2c3","startDate":"2018-12-21","endDate":"2022-01-09","uniqueAddressID":"698629"}'
Resulting in this piece of json excrement:
Code: Select all
{"userMessage":{"type":null,"messageCode":0,"description":null},"ExtraOption":{"$type":"System.Dynamic.ExpandoObject, System.Core"},"dataList":[{"pickupDates":["2019-01-10T00:00:00","2019-01-17T00:00:00","2019-01-24T00:00:00","2019-01-31T00:00:00","2019-02-07T00:00:00","2019-02-14T00:00:00","2019-02-21T00:00:00","2019-02-28T00:00:00","2019-03-07T00:00:00","2019-03-14T00:00:00","2019-03-21T00:00:00","2019-03-28T00:00:00","2019-04-04T00:00:00","2019-04-11T00:00:00","2019-04-18T00:00:00","2019-04-25T00:00:00","2019-05-02T00:00:00","2019-05-09T00:00:00","2019-05-16T00:00:00","2019-05-23T00:00:00","2019-06-01T00:00:00","2019-06-06T00:00:00","2019-06-13T00:00:00","2019-06-20T00:00:00","2019-06-27T00:00:00","2019-07-04T00:00:00","2019-07-11T00:00:00","2019-07-18T00:00:00","2019-07-25T00:00:00","2019-08-01T00:00:00","2019-08-08T00:00:00","2019-08-15T00:00:00","2019-08-22T00:00:00","2019-08-29T00:00:00","2019-09-05T00:00:00","2019-09-12T00:00:00","2019-09-19T00:00:00","2019-09-26T00:00:00","2019-10-03T00:00:00","2019-10-10T00:00:00","2019-10-17T00:00:00","2019-10-24T00:00:00","2019-10-31T00:00:00","2019-11-07T00:00:00","2019-11-14T00:00:00","2019-11-21T00:00:00","2019-11-28T00:00:00","2019-12-05T00:00:00","2019-12-12T00:00:00","2019-12-19T00:00:00","2019-12-28T00:00:00"],"pickupType":10,"_pickupType":10,"_pickupTypeText":"PACKAGES","description":"-"}],"intDataList":null,"data":null,"status":true,"messageCode":107,"token":null,"pdfResponse":null,"ID":null,"invalidParameters":null,"total":0,"messageToString":null}
Does anyone see any way to implement this into the application? Cause I don't. I am not familiar with json parsers and if they are available on the Toon.
It could be implemented with a gateway server which translates to the correct format but I do not really want to implement this, this introduces a step in the process prone to error.