/ / VBA Demande JSON PUT avec concaténation - json, vba

Demande VBA JSON PUT avec concaténation - json, vba

Voici comment je construis mon tableau JSON à envoyer via la méthode PUT où je prends une valeur de cellule d'Excel:

body = "{""note"":""" & Cells(RowNote, 3).Value & """,""uniqueIdentifier:""" & Cells(RowNote, 2).Value & ",""IdentifierType"":""ACCOUNT_ID"",""CustomerId"":" & userID & "}"

Cependant, j'ai eu une erreur 13 incompatibilité.

Voici un exemple de chaîne JSON pouvant être correctement convertie:

{"note":"call again", "uniqueIdentifier":1716, IdentifierType":"ACCOUNT_ID", "CustomerId":927560}

Que faut-il corriger entre parenthèses?

Réponses:

1 pour la réponse № 1

Essayer body = "{""note"":""" & Cells(RowNote, 3).Value & """,""uniqueIdentifier"":" & Cells(RowNote, 2).Value & ",""IdentifierType"":""ACCOUNT_ID"",""CustomerId"":" & UserId & "}" si tu ne veux pas " autour de vos entiers.