项目作者: jadeallencook

项目描述 :
API made using PHP to work with FileMaker databases using AJAX calls.
高级语言: PHP
项目地址: git://github.com/jadeallencook/FileMaker-Server-API.git
创建时间: 2017-01-26T22:25:22Z
项目社区:https://github.com/jadeallencook/FileMaker-Server-API

开源协议:

下载


FileMaker-Server-API

API made using PHP to work with FileMaker databases using AJAX calls.

‘Users’ Table

id name age
110 Jade 20
111 22
112 Jay 27

First Row

Return the first row of a table by just passing the API the layout name.

  1. $.ajax({
  2. url: 'api.php',
  3. method: 'post',
  4. data: {
  5. layout: 'Users'
  6. },
  7. success: function (user) {
  8. console.log(user);
  9. }
  10. });

Results

  1. {
  2. id: 110,
  3. name: 'Jade',
  4. age: 20
  5. }

Row By ID

You can return a row that is equal to an ID by passing it both the ID and what field to find it in.

  1. $.ajax({
  2. url: 'api.php',
  3. method: 'post',
  4. data: {
  5. find: 'id',
  6. id: 112,
  7. layout: 'Users'
  8. },
  9. success: function (user) {
  10. console.log(user);
  11. }
  12. });

Results

  1. {
  2. id: 112,
  3. name: 'Jay',
  4. age: 27
  5. }

Adding New Row

Add a new row of information to the end of any layout.

  1. $.ajax({
  2. url: 'api.php',
  3. method: 'post',
  4. data: {
  5. save: true
  6. data: {
  7. layout: 'Users',
  8. id: 113,
  9. name: 'Josh',
  10. age: 25
  11. }
  12. },
  13. success: function (save) {
  14. console.log(save);
  15. }
  16. });

Updating Row By ID

Update a certain entry by passing the API the row and ID to update along with the data.

  1. $.ajax({
  2. url: 'api.php',
  3. method: 'post',
  4. data: {
  5. layout: 'Users',
  6. save: true,
  7. find: 'id',
  8. id: 111,
  9. data: {
  10. name: 'Nick'
  11. }
  12. },
  13. success: function (save) {
  14. console.log(save);
  15. }
  16. });