-
Notifications
You must be signed in to change notification settings - Fork 2
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
[DT-M3] Create dt-maarifa API to receive contact and interaction data #2
base: master
Are you sure you want to change the base?
Conversation
3 endpoints created. 1st - Create new contact/update if maarifa_data already exists - Ok, if using DT json formating; 2nd - Update based on DT id - Ok, if using DT json formating; 3rd - Create/update interactions - In progress. Create and update are Ok, if using DT json formating, but needs to add some fields. It also remains to map the DT x Maarifa fields and use it before performing the above actions.
… - Maping Maarifa x DT fields Creating function mapFieldsToContact to map Maarifa x DT Fields and contemplate differences and exceptions.
Mapping Maarifa x DT fields and correcting adding and updating comments.
Corrections on Mapping Maarifa x DT fields (tags and milestones).
@adventureit Nice work getting this started. I tested the first endpoint and found a number of problems, so I didn't test the others yet since they will probably have the same ones. Once the bugs below are fixed, I can test the other 2 endpoints and look at the code in more detail. Simple ContactWhen sending to
I get the error:
When sending to I get the error:
However, it does create a contact and will succeed on the second try. After the second try, I noticed these bugs:
FullWhen sending to
I am noticing these bugs:
Code FormattingYou might notice that on this pull request, there is a notice that checks failed. If you click into that, you should be able to see that the PHPCS (PHP code sniffer) - which makes sure the code is formatted in a consistent way - is failing. You can run that check locally by using these commands on your command line:
The third one will try to automatically fix whatever it's able to. Mostly it fixes spacing of the code. The second will tell you exactly what other issues there are. Let me know if any of them are hard to understand. |
Fixing bugs: -maarifa_data field -age field -phone numbers are not split -emails are not split -age not set -maarifa_data set to id instead of full object -Notes fails -Code Formatting
The Maarifa RS currently uses built-in DT APIs to create contacts and comments. This mostly suits our needs right now, but some options to expand the Maarifa Plugin features could use their own API.
Creating 3 endpoints just for the Maarifa Plugin that the RS will send data to directly and DT can handle some special cases better.
-POST /wp-json/dt-maarifa/v1/contacts
-POST /wp-json/dt-maarifa/v1/contacts/:id
-POST /wp-json/dt-maarifa/v1/contacts/:id/interactions