PHP REST and SQLLITE

PHP REST and SQLLITE

Cancelled

Job Description

Must be done in standard oop classes using public and private methods etc.

Estimate 3 hours work.

4 classes should be all that is required
• REST client and to obtain a response and decode json response and post a json response
• Calling script to call the REST client class and do something with the data in response
• Read / write sqllite
• JSON encoder and decoder

1 control
• /getDDI to run 1

Access mysite.com/getDDI to call class 1 ( a JSON response page)


1) Requesting function to request the REST Client class
fetch a response from REST client / class 2
format returned decoded data sent back ready for insertion into sqllite database
Insert into a sqllite table with columns (translates_to, ddi_type, ddi, status) (Create a sqllite class Read / Write class)
If insertion into table was successfull echo ddi date to the calling class in a json encoded datatype so that a javascript file can read the repsonse by hitting mysite.tld/getDDI (use the variable in object, no point in doing a database read here)

2) REST client to get external.com:port/translationrequest?api_key=xxxyyy&ddi_type=0800&translation=441234567890&format=json
get response;
Read the JSON data and decode (build a seperate json encoder and decoder script / class).
Return data back to requesting function (The json response is {"translation":{"translates_to":441234567890,"ddi_type":800,"ddi":8000588026},"status":{"reason":"","type":"success"}})

3) sqllite class to create the database (Call it Dials) and table if not exists (Called DDIs).
4) little function to read / output all rows from the table DDIs

Above I want to be able to access mysite.com/Showtable and get a respponse of the data and that the data has been added into the table, with the table ouput listed beneth the echoed response

---
Skills: json