epipko
09/30/2024, 3:32 PMJSON parsing failure at character 1:'<' in <!DOCTYPE html> <html lang="en"> <head> <InvalidTag charset="utf-8"> <title>Error</title> </head> <body> <pre>Internal Server Error</pre> </body> </html>
Does it mean an issue on the remote site?dinie
10/03/2024, 1:58 AMJordan Ross
10/03/2024, 6:17 PMJordan Ross
10/03/2024, 6:17 PMgsr
10/07/2024, 1:19 PMgsr
10/07/2024, 7:32 PMalholden
10/08/2024, 11:50 PMhugh
10/18/2024, 8:06 PMepipko
10/21/2024, 6:34 PM<cfset *File* = "\\Prod\c$\Temp\Kohls.xlsx">
<cfspreadsheet action="read" *name*="cust" src="#File#" *query*="myQuery" />
<cfoutput>#cust#</cfoutput>
Attribute validation error for tag CFSPREADSHEET.
It has an invalid attribute combination: action,name,query,src. Possible combinations are:
Required attributes: 'action'. Optional attributes: 'columnnames,columns,excludeheaderrow,format,headerrow,name,rows,sheet,src'.
Required attributes: 'action'. Optional attributes: 'columnnames,columns,excludeheaderrow,format,headerrow,name,rows,sheetname,src'.
Required attributes: 'action'. Optional attributes: 'columnnames,columns,excludeheaderrow,headerrow,query,rows,sheet,src'.
Required attributes: 'action'. Optional attributes: 'columnnames,columns,excludeheaderrow,headerrow,query,rows,sheetname,src'.
Required attributes: 'action'. Optional attributes: 'columnnames,excludeheaderrow,format,headerrow,name,rows,sheet,src'.
Required attributes: 'action'. Optional attributes: 'columnnames,excludeheaderrow,headerrow,query,rows,sheet,src'.
Required attributes: 'action'. Optional attributes: 'columnnames,excludeheaderrow,headerrow,query,rows,sheetname,src'.epipko
10/29/2024, 10:35 PMgsr
11/03/2024, 1:32 PMepipko
12/06/2024, 8:50 PMcurl -X POST \
<https://your-development-store.myshopify.com/admin/api/2024-10/graphql.json> \
-H 'Content-*Type*: application/json' \
-H 'X-Shopify-*Access*-Token: {access_token}' \
-d '{
"query": "query { draftOrders(first: 10) { edges { node { id } } } }"
}'
I usually convert that into cfhttp call by replacing -H with cfhttpparam type="header" ...
But what type of transaction type is -d ? Is it type="body"?epipko
12/11/2024, 9:42 PM<cfset gql = '{"query": "{products(first: 3) {edges {node {id title} }}}"}'>
I want to be able to save potentially larger query in this format.
How do I do that? (Sending it as is will not work)
<cfset gql = '{
"query": "{
products(first: 3) {
edges {
node {
id
title
}
}
}
}"
}'
>
epipko
12/31/2024, 7:57 AM<cfset gql = '{orders(first: 3, query: "id:>=5790166450355", sortKey: CREATED_AT) {edges {node {id name risk {recommendation } updatedAt } } } }'>
<cfoutput>#gql#<br /><br /></cfoutput>
This returns:
{orders(*first*: 3, *query*: "id:>=5790166450355", sortKey: CREATED_AT) {edges {node {id *name* risk {recommendation } updatedAt } } } }
I copy/past it into GraphiQL app in Shopify and it works just fine.
When I pass it into <cfhttp>
<cfhttp
url="<https://unionbay-clothing.myshopify.com/admin/api/2024-10/graphql.json>"
method="POST"
resolveurl="true"
timeout="60"
result="httpResp">
<cfhttpparam type="header" name="X-Shopify-Access-Token" value="secret_key" />
<cfhttpparam type="header" name="Content-Type" value="application/json" />
<cfhttpparam type="header" name="Accept" value="application/json" />
<cfhttpparam type="body" value="#gql#">
</cfhttp>
<cfdump var="#httpResp#" abort="true">
it returns:
{"status":400,"error":"The json provided is not formatted correctly: Error occurred while parsing request parameters"}
All attempts to work with Shopify support end up with "Works on our end. It must be the way your app sends in a request. Contact Adobe for help."
Does anyone know if <cfhttp> actually sends cURL command on the back end?epipko
12/31/2024, 7:59 AMepipko
01/15/2025, 5:35 PM<cfset jsonData = deserializeJSON(httpResp.fileContent) />
epipko
01/23/2025, 6:43 PM<cfif #risk_httpResp.Filecontent# EQ "{"risks":[]}">
Risk Analysis is not available
</cfif>
Invalid CFML construct found on line 28 at column 58
28 : <cfif #risk_httpResp.Filecontent# EQ "{"risks":[]}">
29 : Risk Analysis is not available
30 : </cfif>
Do I need to escape specific character(s)? If so, how?johnbarrett
01/28/2025, 1:39 AMmolluskorg
02/06/2025, 8:43 PMepipko
02/28/2025, 6:28 PMDavid Johnson
03/03/2025, 4:06 PMjohnbarrett
03/11/2025, 5:34 AM<!--- Application.cfc ---> <cfcomponent output="false">
<!--- Turn on session management. --->
<cfset this.sessionManagement=true>
<!--- Default datasource --->
<cfset this.dataSource="codingtask">
<cffunction name="onRequestStart" output="false" returnType="void">
<!--- If user isn't logged in, force them to now --->
<cfif not isDefined("session.auth.isLoggedIn")>
<!--- If the user is now submitting "Login" form, --->
<!--- Include "Login Check" code to validate user --->
<cfif isDefined("form.UserLogin")>
<cfinclude template="loginCheck.cfm">
</cfif>
<cfinclude template="loginForm.cfm">
<cfabort>
</cfif>
</cffunction>
</cfcomponent>
----------------------------------------LoginForm.cfm-----------------------------------------------------------------<!--- If the user is now submitting "Login" form, --->
<!--- Include "Login Check" code to validate user --->
<cfif isDefined("form.UserLogin")>
<cfinclude template="LoginCheck.cfm">
</cfif>
<html>
<head>
<title>Please Log In</title>
</head>
<body>
<!--- Start our Login Form --->
<form action="LoginCheck.cfm" name="LoginForm" method="post">
<!--- Use an HTML table for simple formatting --->
<table border="0">
<tr><th colspan="2" bgcolor="silver">Please Log In</th></tr>
<tr>
<th>Username:</th>
<td>
<!--- Text field for "User Name" --->
<input
type="text"
name="userLogin"
size="20"
value=""
maxlength="100"
required="Yes">
</td>
</tr><tr>
<th>Password:</th>
<td>
<!--- Text field for Password --->
<input
type="password"
name="userPassword"
size="12"
value=""
maxlength="100"
required="Yes">
<!--- Submit Button that reads "Enter" --->
<input type="Submit" value="Enter">
</td>
</tr>
</table>
</form>
</body>
</html>
--------------------------------------------LoginCheck.cfm------------------------------------------------------------<!--- Make sure we have Login name and Password --->
<cfparam name="form.userLogin" type="string">
<cfparam name="form.userPassword" type="string">
<!--- Find record with this Username/Password --->
<!--- If no rows returned, password not valid --->
<cfquery name="getUser">
SELECT ContactID, FirstName
FROM Users
WHERE UserLogin =
<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.UserLogin#">
AND UserPassword =
<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.UserPassword#">
</cfquery>
<!--- If the username and password are correct --->
<cfif getUser.recordCount eq 1>
<!--- Remember user's logged-in status, plus --->
<!--- ContactID and First Name, in structure --->
<cfset SESSION.auth = structNew()>
<cfset SESSION.auth.isLoggedIn = "Yes">
<cfset SESSION.auth.contactID = getUser.contactID>
<cfset SESSION.auth.firstName = getUser.firstName>
<cflocation url="welcome.cfm">
</cfif>
rodyon
03/13/2025, 11:44 AMrodyon
03/13/2025, 11:46 AMrodyon
03/13/2025, 11:48 AMrodyon
03/13/2025, 11:48 AMepipko
03/17/2025, 6:19 PM<cfset jsonData = deserializeJSON(httpResp.fileContent) />
<cfdump var=#jsonData#>
<cfset item_qty = ArrayLen(jsonData.line_items)>
<cfoutput>#item_qty#</cfoutput>
David Johnson
03/20/2025, 1:54 PMDavid Johnson
03/20/2025, 1:55 PMepipko
03/21/2025, 4:31 PM