Send OCPI messages

Now that we have connected to the OCN public test environment, we can make use of OCPI to find point of interest data, issue remote commands at charge points and authorize RFID cards.

Note that the following examples do not include message signing. As the node we are connecting to does not require messages to be signed, we can leave this additional step out for now. See the Message Signing wiki page for more information.

Please note that you have to replace “qa-client.emobilify.com” with “ocnnode.elaad.io” when you are using Elaad’s Test OCN Node.

 

Testing with the Mock CPO

We have a mock CPO connected to the public test environment which can be used to test an MSP implementation. The details are as follows:

  • country_code: CH

  • party_id: CPO

 

To send a request to this CPO, we need to make use of OCPI version 2.2 routing headers. Below is an example curl request, which will get locations from our mock CPO. Replace the authorization token, as well as the OCPI-From headers with the relevant data for your service:

curl https://qa-client.emobilify.com/ocpi/sender/2.2/locations \ -H 'Authorization: Token {{TOKEN_A}}' \ -H 'X-Request-ID: 0' \ -H 'X-Correlation-ID: 0' \ -H 'OCPI-From-Country-Code: {{COUNTRY_CODE}}' \ -H 'OCPI-From-Party-ID: {{PARTY_ID}}' \ -H 'OCPI-From-Country-Code: CH' \ -H 'OCPI-From-Party-ID: CPO' \

 

Testing with the Mock MSP

The mock MSP has less functionality than that of the CPO, but we can still use it to test aspects of a CPO implementation. The details are as follows:

  • country_code: CH

  • party_id: MSP

 

We can test, for example, the sending of a session update to the MSP:

curl https://qa-client.emobilify.com/ocpi/receiver/2.2/sessions \ -H 'Authorization: Token {{TOKEN_A}}' \ -H 'X-Request-ID: 0' \ -H 'X-Correlation-ID: 0' \ -H 'OCPI-From-Country-Code: {{COUNTRY_CODE}}' \ -H 'OCPI-From-Party-ID: {{PARTY_ID}}' \ -H 'OCPI-From-Country-Code: CH' \ -H 'OCPI-From-Party-ID: MSP' \ -d '{{SESSION_DATA}}'