HTTP Request API - INT parametr

Hello,

I have problem with HTTP request - API requires to some values send as INT instead of String.

It is working if im using object as HTTP request body ex:

"{
 'customerId':15552334,
 'parentId':'927764',
}"

So look:
cusomerId as int - without quotes
parametrId as string - within quoutes
And it`s fine, api work correctly, but i want to have multiple customer/parent ids and api calls so i want use it as variable instead. Can create JSON object from variables, looking like above?

I cant use parametrs in HTTP request properties - unable to select parametr type other than string, and if i simply put parentId(which should be int) in quotes as string - API simply return error.

You can generate the json string with string concatenation or String.Format:

jsonString = String.Format("{{ 'customerId':{0}, 'parentId':'{1}'}}", customerId, parentId)

Thank you @ptrobot

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.