Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

mormot-WP-REST-API

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

A mORMot WP REST API (and WooCommerce API) consumer

####The content: WPRestAPI/WPRestAPI.pas

  • the library enables to consume Wordpress(or Woocommerce) data and to work with them using ORM classes
  • processes Authentication

WPRESTAPIModels/WPRESTAPIModels.pas

  • example of ORM classes for Wordpress ( or Woocommerce) records

chimera

WPRESTAPI.json

  • file of setting for consuming of WP REST API
  • it is neccessary to complement it by own values

WOORESTAPI.json

  • file of setting for consuming of WooCommerce API
  • it is neccessary to complement it by own values

wordpressOauth.dpr, wordpressaurh.pas,ordpressaurh.dfm

  • project example

Requirements:

####Documentation:

####Settings:

  • for Wordpress consuming (WP REST API)
    • file WPRESTAPI.json
      pascal
      {"fieldCount":15,"values":["Server","Port","RestAPI","WPOauth","HTTPS","ConsumerKey","ConsumerKeySecret","URL","AccessToken","AccessTokenSecret","WPUser","WPPassword","Expirated","RESTAPIVersion","OAuthPluginVersion","[your-WP-server]","[WP-port]","wp-json","oauth1",[WP-secure],"[your-consumer-key]","[your-consumer-secret-key]","[WP-REST-API-Url]","","","[your-WP-user]","[your-WP-pwd]",null,"","0.3.0"]}
      • [WP-port] - if empty string then is taken 80 as default value
      • [WP-secure] - true/false
      • [WP-REST-API-Url] - http[s]://[your-WP-server]/wp-json/
      • [your-consumer-key], [your-consumer-secret-key] -> these keys are generated by Oauth1 plugin
      • AccessToken, AccessTokenSecret,Expired - will be complemented after the authentication
      • [your-WP-user],[your-WP-pwd] - Wordpress user with corresponding capabilities ( read-.., edit-..,create-..)
      • OAuthPluginVersion - the version of https://github.com/WP-API/OAuth1 plugin (0.2.1 or 0.3.0)
  • for Woocommerce consuming (Woocommerce API)
    • file WOORESTAPI.json
      pascal
      {"fieldCount":15,"values":["Server","Port","RestAPI","Oauth","HTTPS","ConsumerKey","ConsumerKeySecret","URL","AccessToken","AccessTokenSecret","WPUser","WPPassword","Expirated","RESTAPIVersion","OAUthPluginVersion","[your-WP-server]","[WP-port]","wc-api","",[WP-secure],"[your-consumer-key]","[your-consumer-secret-key]","[WP-REST-API-Url]","","","","","","[Woocommerce API version]",""]}
      • [WP-port] - if empty string then is taken 80 as default value
      • [WP-secure] - true/false
      • OAuth - not used
      • [WP-REST-API-Url] - http[s]://[your-WP-server]/wc-api/[Woocommerce API version]/
      • [your-consumer-key], [your-consumer-secret-key] -> these keys are generated by Oauth1 plugin
      • AccessToken, AccessTokenSecret,Expired - not used
      • WPUser, WPPassword - not used
      • OAuthPluginVersion - not used

LICENSE

The MIT License