DivideBV / Postnl

Library to connect to PostNL's SOAP service called CIF
GNU General Public License v2.0
31 stars 40 forks source link

2_2 api is online #55

Open matthijs-neijenhuijs opened 7 years ago

matthijs-neijenhuijs commented 7 years ago
Interface Version 2_2
Sandbox endpoint https://api-sandbox.postnl.nl/shipment/v2_2/calculate/date/
Sandbox WSDL https://api-sandbox.postnl.nl/shipment/v2_2/calculate/date/
Production endpoint https://api.postnl.nl/shipment/v2_2/calculate/date
Production WSDL https://api.postnl.nl/shipment/v2_2/calculate/date/soap.wsdl
slokhorst commented 7 years ago

Hm, interesting. It looks like they are changing everything from SOAP to REST.

PostNL has launched a new API platform Since 24 August 2017. The formal webservices have been migrated to this platform, so that we can keep providing good service. It is recommended to use the above endpoints.

Anyone knows more about this?

PaulVanDeKamer commented 7 years ago

Hi all, Are the new enpoints already implemented?

slokhorst commented 7 years ago

@PaulVanDeKamer no. I'm not even sure if it's possible to use the new version via the SOAP interface. All endpoints listed seem to return JSON stuff.

ameenross commented 7 years ago

Also, apparently they're using OAuth2? I guess this library is becoming more or less obsolete, or a complete rewrite is required.

PaulVanDeKamer commented 7 years ago

The sundown of the old API is on 15 oktober and they strongly advice to migrate to the new api before this date. Was told by a employe that the only thing changed is the authentication part.

PaulVanDeKamer commented 7 years ago

More info can be found here: https://developer.postnl.nl/apis/new-api-platform?trc=k-em_f-f_d-20170824_c-10_m-Nieuw%20API%20platform%20groep2%20NL%20ENG_l-hier

ameenross commented 7 years ago

So it's not really OAuth2, just simple token auth? It's strange that they would return an errorcode with oauth in it then... steps.oauth.v2.FailedToResolveAPIKey

This is kind of worrying though. Especially the fact that there doesn't seem to be any actual technical documentation about this yet. Apart from that announcement (which does not appear to be linked from anywhere) there's nothing. I'm currently awaiting information from a PostNL account manager.

PaulVanDeKamer commented 7 years ago

To get a AUTH Key you have to email with "CIT servicedesk" -< Neem contact op met de CIT Servicedesk (zie contactgegevens onderaan dit bericht) voor toegang tot de API Manager portal om de API keys op te halen en te beheren. Voor de aanvraag zijn naam en e-mailadres nodig. >- -< citservicedesk@postnl.nl >- They are revering to https://developer.postnl.nl/ I just got an email back and have access to our apimanager.

Niels10 commented 7 years ago

@slokhorst. The new APIs can have both SOAP and REST (at the same endpoint). So it can be that JSON will return by using the interface. For SOAP, the API accepts POST requests by using the Content-Type header text / xml. The SOAP message can then be sent in the body of the request.

matthijs-neijenhuijs commented 7 years ago

The available option for the cutt of times is really great.

PaulVanDeKamer commented 7 years ago

Hi All, Any news on the new API? Is this lib going to support the new version?

slokhorst commented 7 years ago

I don't really know what we should do here.. The "New API platform" page is very vague and doesn't give any technical details. The only concrete instruction there is the following, but that wouldn't require any changes to this library, I guess?

You can also fill in the API key in the former password field and send the same CIF requests as you did before.

The rest of the SOAP documentation and examples are a big mess. In some of them they have half-removed the wsse:Security header and left some misformatted, broken XML, in others, they have just left the old one containing wsse:Username and wsse:Password. There is no "API key" to be found anywhere in those example requests.

Furthermore I still haven't received any email or other notice from PostNL. It would be truly ridiculous if they shut down the old method in less than a month.