Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SOLVED WHM DNS API - what does "unencoded" mean?

Discussion in 'cPanel Developers' started by pv2b, Mar 23, 2018.

Tags:
  1. pv2b

    pv2b Registered

    Joined:
    Mar 23, 2018
    Messages:
    3
    Likes Received:
    1
    Trophy Points:
    1
    Location:
    Stockholm
    cPanel Access Level:
    Reseller Owner
    Hi.

    I'm trying to call the "addzonerecord" method of the WMI API 1 in order to programmatically create TXT records in DNS. Link to docs for convenience: WHM API 1 Functions - addzonerecord - Developer Documentation - cPanel Documentation

    Under the section "TXT Record Parameters", there is a parameter "unencoded" which has the following "documentation":

    Parameter: unencoded
    Type: Boolean
    Description: Whether the TXT record's data is encoded.
    Possible values: 1 — Encoded. / 0 — Not encoded.
    Example: 1

    Other than the fact that it's confusingly named (unencoded=1 means encoded...) I don't actually understand what this flag does, and despite some testing on my side, I have not been able to see any difference with this flag set or clear.

    So what does this flag actually do?
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,802
    Likes Received:
    1,895
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Can you verify what method you are using to test this API function? For instance, are you testing with an encoded URL with the API call in a web browser, or through the command line?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. pv2b

    pv2b Registered

    Joined:
    Mar 23, 2018
    Messages:
    3
    Likes Received:
    1
    Trophy Points:
    1
    Location:
    Stockholm
    cPanel Access Level:
    Reseller Owner
    Hello.

    I'm writing a Powershell script to interact with the API. Find my code attached (maybe someone can find it useful as a sample...) It works fine for me right now (although I had to work around a few annoying Powershell bugs).

    That said, the API doesn't really care what's calling the method. I want to understand what "unencoded" means in terms of the spec of the API.
     

    Attached Files:

  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,802
    Likes Received:
    1,895
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    I notice the same behavior that you see in that the actual record that appears in the DNS zone doesn't appear to change based on the use of the unencoded parameter. I've opened internal case CPANEL-19498 to verify if there's another purpose for the "unencoded" parameter that's not fully documented. I'll monitor the case and update this thread with more information as it becomes available.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,802
    Likes Received:
    1,895
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    To update, it looks like the parameter is accepted, but it's usage is filtered out. Thus, there currently doesn't appear to be a valid use of this parameter. I've opened an internal case (DOC-10543) with our Documentation Team to have our documentation updated to reflect this information.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. pv2b

    pv2b Registered

    Joined:
    Mar 23, 2018
    Messages:
    3
    Likes Received:
    1
    Trophy Points:
    1
    Location:
    Stockholm
    cPanel Access Level:
    Reseller Owner
    Sounds good. That means I can probably get away with not passing that parameter into the API call at all.

    Thanks!
     
    cPanelMichael likes this.
  7. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,802
    Likes Received:
    1,895
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    The "unencoded" parameter is now removed from the document.

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice