ไลบรารี่สำหรับใช้งาน iThenticate API ได้ง่ายและรวดเร็วยิ่งขึ้น เพื่อตรวจสอบและป้องกันการลอกเลียนแบบ
คุณสามารถติดตั้งผ่านตัวจัดการแพ็คเกจ ผู้แต่ง ด้วยคำสั่งต่อไปนี้:
composer.phar require bsobbe/ iThenticate "*"
หรือเพิ่มสิ่งต่อไปนี้ลงในไฟล์ composer.json ของคุณ:
"require": {
"bsobbe/ iThenticate ": "*"
},
เมื่อการติดตั้งเสร็จสิ้น เพียงใช้ไลบรารี่กับ:
use bsobbe iThenticate iThenticate ;
คุณจะสามารถใช้ไลบรารีได้โดยการสร้างอินสแตนซ์ของคลาส iThenticate
ตรวจสอบให้แน่ใจว่าคุณส่ง ชื่อผู้ใช้ และ รหัสผ่าน iThenticate API ไปยังตัวสร้าง (คุณอาจต้องใช้ SSL เพื่อเชื่อมต่อกับ API):
$ iThenticate = new iThenticate ( " Your username " , " Your password " );
ท้ายที่สุด เพียงแค่เรียกแต่ละวิธีที่คุณต้องการใช้เพื่อส่งพารามิเตอร์ที่จำเป็น จากนั้นไลบรารีจะจัดการส่วนที่เหลือเอง
ฉันขอแนะนำอย่างยิ่งให้อ่านคู่มือ iThenticate API ก่อนที่จะใช้ไลบรารีและวิธีการต่างๆ
นี่เป็นตัวอย่างง่ายๆ ในการส่งเอกสารใหม่:
$ iThenticate = new bsobbe iThenticate iThenticate ( " username " , " password " );
//The value in result variable is the document_id of the inserted document.
$ result = $ iThenticate -> submitDocument (
" Cloud Computing " ,
" Sobhan " ,
" Bagheri " ,
" CloudComputingEssay.pdf " , //File name from the object of the uploaded temp file.
$ content , //Document content fetched with php file_get_contents() function from the document file.
649216 //Folder number to store document (You can get folder number from last part of iThenticate panel URL).
);
$ iThenticate = new bsobbe iThenticate iThenticate ( " username " , " password " );
$ result = $ iThenticate -> documentGetRequest ( 12345 );
// Since we are requesting 1 document, there should be 1 document only in the response.
$ document = reset ( $ result [ ' documents ' ]);
$ is_pending = $ document [ ' is_pending ' ]; // If the report is pending.
$ document_id = $ document [ ' id ' ];
$ processed_time = $ document [ ' processed_time ' ]; // The time the report has been created.
$ percent_match = $ document [ ' percent_match ' ]; // The percentage match for the document.
$ title = $ document [ ' title ' ]; // The submitted title of the document.
$ uploaded_time = $ document [ ' uploaded_time ' ]; // The time the document was uploaded.
// Also, $document['folder'] is available containing information related to the folder that the document is submitted
// into.
$ iThenticate = new bsobbe iThenticate iThenticate ( " username " , " password " );
$ result = $ iThenticate -> reportGetRequest ( 98765 , 1 , 1 , 1 ); // The report ID.
$ view_only_url = $ result [ ' view_only_url ' ];
$ view_only_expires = $ result [ ' view_only_expires ' ];
$ report_url = $ result [ ' report_url ' ];
รู้สึกอิสระที่จะ มีส่วนร่วม และเพิ่มวิธีการใหม่ๆ ตามคู่มือ API ของ iThenticate
เพิ่มคำแนะนำการใช้วิธีใน ReadMe.md