Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    Using Variables_CreateOrUpdateVariableDeclaration with the JSON api

    Scheduled Pinned Locked Moved Support
    applicationsapivariablesbuildmaster
    3 Posts 1 Posters 10 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ? This user is from outside of this forum
      Guest
      last edited by

      I am trying to create Free Text variables with the Json api.

      Here is the JSON I am posting to Variables_CreateOrUpdateVariableDeclaration:

      {
      "API_Key":"apikey1",
      "teamcity_build":"my_variable_name",
      "Scope_Code":"X",
      "Scoped_Application_Id":14,
      "Scoped_Environment_Id":3,
      "Required_Indicator":"Y",
      "Variable_Configuration":"<Inedo.BuildMaster.Extensibility.Variables.FreeTextVariable Assembly="BuildMasterExtensions"><Properties /></Inedo.BuildMaster.Extensibility.Variables.FreeTextVariable>",
      "Sensitive_Indicator":"N"}

      Here is the response I get:

      9413161Variables_CreateOrUpdateVariableDeclaration24`XML parsing: line 1, character 70, A string literal was expected

      Can you please help me resolve the issue?

      Product: BuildMaster
      Version: 4.5.2

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        I would also like to note, I am using C# and the issue appears to come from the quotes around Assembly name. I am unsure how else to send it as I have to escape the double quotes on my side. So if you could get a C# sample that creates a variable declaration that would be much appreciated. Thank you.

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          Using a \ character is correct for escaping in JSON; that should work. We will try to reproduce this, but in the meantime are you able to use single quotes instead in the XML?

          Assembly='BuildMasterExtensions'
          

          should also parse as valid XML if I'm not mistaken.

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • 1 / 1
          • First post
            Last post
          Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation