I was able to connect and change my shopdata with a API instruction.
The data string looks like this :
cData := '{"images":["5101000.jpg"],"sku":"skuData","ean":"98745123456","name":"Noyca","description":"Memo<b>Data</b>"}'
the API docs gives this a example data :
{
"model": "string",
"sku": "string",
"ean": "string",
"name": "string",
"description": "string",
"introDescription": "string",
"extraDescription": "string",
"metaTitle": "string",
"metaKeyword": "string",
"metaDescription": "string",
"quantity": 0,
"categoryId": 0,
"price": 0,
"purchasePrice": 0,
"status": true,
"taxRate": 0,
"manufacturerId": 0,
"width": 0,
"height": 0,
"weight": 0,
"images": [
"ImageOne"
],
"imagesAlt": [
"ImageOneAlt"
],
"resources": [
{
"resourceKey": "key",
"resourceValue": "value",
"resourceType": "type"
}
]
}
My question : Look at the last data : resources. It has several subdata's like Key, Value, Type....
I suspect that FWH has functions already build for generating this kind of strings, thinking that the data origin in my case sits in a dbf.
I know that i have to make a matching function for the dbf data to the online data.
Do these functions exist ? of do I have to make a function myself to generate this kind of string (cData as example)
Best FWH functions for API, Hash, Curl
- Marc Venken
- Posts: 1485
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
- leandro
- Posts: 1744
- Joined: Wed Oct 26, 2005 2:49 pm
- Location: Colombia
- Has thanked: 34 times
- Been thanked: 10 times
- Contact:
Re: Best FWH functions for API, Hash, Curl
Creo que es lo que necesitas
Code: Select all | Expand
cData := hb_jsonEncode( hData )
.....
Local := hData := {=>}
hb_jsondecode(cData,@hData )
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com
[ Turbo Incremental Link64 6.98 Embarcadero 7.70 ] [ FiveWin 24.09 ] [ xHarbour 64 bits) ]
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com
[ Turbo Incremental Link64 6.98 Embarcadero 7.70 ] [ FiveWin 24.09 ] [ xHarbour 64 bits) ]
- Marc Venken
- Posts: 1485
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
Re: Best FWH functions for API, Hash, Curl
leandro wrote:Creo que es lo que necesitasCode: Select all | Expand
cData := hb_jsonEncode( hData )
.....
Local := hData := {=>}
hb_jsondecode(cData,@hData )
Hey,
I can read the data and see it in xbrowse, but I want to put ALL fields into a dbf, because dbf I can handle/workwith.
Hashes I can work when they are simple like :
h2 := FW_RecToHash(), ;
oBrwT:LButtonUp(), ;
h1["positie"] = "100" ,;
FW_HashToRec( h1 ), ;
DBGOTO( nPos1 ), ;
FW_HashToRec( h2 ), ;
In the large datafile that comes from my site the hashes are more complex. I think like multidimensional or so and that is difficult for now
Marc Venken
Using: FWH 23.08 with Harbour
Using: FWH 23.08 with Harbour