JSON Parser issue

DanielG
Tera Contributor

I'm sending the following variable value to the salesforce rest API.

However, it looks like the (semicolon) at the end of my variable is being passed as well.

Screenshot 2023-03-10 at 2.34.31 PM.png

Here is my request body:

 

 

{"Status":"New","Type":"User Account Set Up - I need access to:","Case_Reason_Submitted__c":"Salesforce","Subject": "SFDC re-activation for Joshua Martinez","Description": "Requester Name: Samuel Martinez\nAccess Reason: Opportunity Owner\nPlease Provide access reason: \nMirror User: Tom Smith\nManager Name: Scott Ross\nDescription/Business Justification: Testing\nTeam LOB: SLV","Priority":"Low"};

 

 

 

 

As a result its causing a JSON parser error when i send this in my request body: 

Screenshot 2023-03-10 at 2.52.28 PM.png

 

How do I fix this parsing issue?

1 ACCEPTED SOLUTION

Allen Andreas
Administrator
Administrator

Hi,

Hmm, I do see where it can't deserialize with that semicolon there. Can you share the entire concatenated version of what you're doing? As we can see in your request body, it's more than just the sfDescription, that's only the middle portion. What does it look like where you're building the whole thing? Perhaps there's an extra character there somewhere.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

3 REPLIES 3

Allen Andreas
Administrator
Administrator

Hi,

Hmm, I do see where it can't deserialize with that semicolon there. Can you share the entire concatenated version of what you're doing? As we can see in your request body, it's more than just the sfDescription, that's only the middle portion. What does it look like where you're building the whole thing? Perhaps there's an extra character there somewhere.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Ah, I forgot to remove the additional semicolon from my body variable. Thank you for you help @Allen Andreas 

Screenshot 2023-03-13 at 12.43.05 PM.png

Hi @DanielG 

Bingo! 😉 - thanks for checking!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!