Json api curl

This is the place to offer or seek development services - offer to build apps for others or find a developer to work for you

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
Thomas seewald
Posts: 2
Joined: Mon Sep 26, 2016 12:06 pm

Json api curl

Post by Thomas seewald » Tue Nov 26, 2019 3:28 pm

Hello, I'm always looking for a programmer. I also like to pay for this service. Please have a look at my code.
The first part ("if 1 is 2 then") works fine.
The curl string also works in the terminal.

I guess the problem is the assembly of the Json part.
If you have an idea write me with your asking price to
ts Oduodu . de
Thank you. I'll take care of it.

This is working in terminal
curl -v -X POST -u userpassword -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'X-Billbee-Api-Key: mykey' -d '{ "Sku": "1000774", "NewQuantity": 2, "ForceSendStockToShops": false }' 'thisurl'


on mouseup
resetall
if 1 is 2 then

put "curl -v -X POST -u user:password -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'X-Billbee-Api-Key:mykey' -d '{ ''Sku'': ''1000774'', ''NewQuantity'': 3, ''ForceSendStockToShops'': false }' 'thisurl' " into zusenden

replace "''" with quote in zusenden
put shell(zusenden) into inhalt
put the result into xp
end if

put "Authorization: Basic" && base64Encode("user:password") into tHeader
put cr&"Accept: application/json" after tHeader
put cr&"X-Billbee-Api-Key: my code" after tHeader
set the httpHeaders to tHeader


put "{ 'Sku': '1000774', 'NewQuantity': 2, 'ForceSendStockToShops': false }" into zusenden ----> I think there is the mistake
replace "'" with quote in zusenden

post zusenden to url "thisurl"
put the result into xp
put libUrlLastRhHeaders() into xx
put it into inhalt
end mouseup

inhalt --> {"ErrorMessage":"Parameter SKU is empty","ErrorCode":11,"Data":null}
xp --> tsneterr: HTTP response code 400 returned from server

Post Reply

Return to “Developer Services Marketplace”