Gravity Forms
Interact with the Gravity Forms API using SQL Server
- Install the SQLHTTP database on your SQL Server
- Obtain a Public Key and a Private Key from your WordPress GravityForms Plugin Settings Page
- Create the stored procedures documented below
- Execute the following SQL statement:
1 2 3 4 5 6 |
EXEC usp_GravityForms_Auth_Init @Profile = 'enter-profile-name-of-your-choosing', @RootURL = 'enter-your-root-web-address', @PublicKey = 'enter-your-public-key', @PrivateKey = 'enter-your-private-key' |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
CREATE PROCEDURE usp_GravityForms_Auth_Init( @Profile nvarchar(100), @RootURL nvarchar(200), @PublicKey nvarchar(100), @PrivateKey nvarchar(100)) AS SET NOCOUNT ON EXEC SQLHTTP.net.AuthParamSet @Profile = @Profile, @Name = 'RootURL', @Value = @RootURL EXEC SQLHTTP.net.AuthParamSet @Profile = @Profile, @Name = 'PublicKey', @Value = @PublicKey EXEC SQLHTTP.net.AuthParamSet @Profile = @Profile, @Name = 'PrivateKey', @Value = @PrivateKey GO |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
CREATE PROCEDURE usp_GravityForms_AuthParameters( @Profile nvarchar(100), @Method varchar(10) = 'GET', @Path nvarchar(MAX), @PublicKey nvarchar(100) OUTPUT, @UNIXTime bigint OUTPUT, @Signature nvarchar(100) OUTPUT) AS DECLARE @PrivateKey nvarchar(100) DECLARE @Str nvarchar(MAX) SET @PublicKey = SQLHTTP.net.AuthParam(@Profile, 'PublicKey') SET @PrivateKey = SQLHTTP.net.AuthParam(@Profile, 'PrivateKey') SET @UNIXTime = CONVERT(bigint, SQLHTTP.net.DateTime2_To_UnixTime(DATEADD(week, 1, GetDate()))) SET @Str = @PublicKey + N':' COLLATE SQL_Latin1_General_CP1_CI_AS + @Method + N':' COLLATE SQL_Latin1_General_CP1_CI_AS + @Path + N':' COLLATE SQL_Latin1_General_CP1_CI_AS + CONVERT(nvarchar(50), @UNIXTime) SET @Signature = SQLHTTP.net.URLEncode( SQLHTTP.net.Binary_To_Base64( SQLHTTP.net.HMACString('SHA1', @Str, @PrivateKey) ) ) GO |
IMPORTANT DISCLAIMER
CODE/SQL ON THESE PAGES ARE PROVIDED AS-IS AND ARE AVAILABLE FOR ILLUSTRATIVE PURPOSES ONLY.
USERS ARE REQUIRED TO ABIDE BY THE TERMS AND CONDITIONS FOR USING REFERENCED THIRD PARTY WEBSITES AND/OR APIs FROM THEIR RESPECTIVE WEBSITES. WE DO NOT CONDONE ANY VIOLATION OF THIRD PARTY WEBSITES AND/OR APIs TERMS AND CONDITIONS USING OUR SOFTWARE.
USERS SHALL BE SOLELY RESPONSIBLE AND BE SOLELY LIABLE FOR VIOLATION OF ANY RULES SPECIFIED BY THIRD PARTIES FOR USING THEIR WEBSITES AND/OR APIs, OR INFRINGEMENT OF RIGHTS OF SUCH THIRD PARTIES.