• GoDaddy Community
  • Website Design & Development
  • Website Design & Development

    cancel
    Showing results for 
    Show  only  | Search instead for 
    Did you mean: 
    Go to solution

    Domain Forwarding with API error: "Request body doesn't fulfill schema"

    curl -i -X PUT -H "Authorization: sso-key $MY_KEY:$MY_SECRET" -H "Accept: application/json" -H "Content-Type: application/json" --data [{"fqdn":"$fqdn","mask":{"title":"$title"},"type":{"MASKED","REDIRECT_TEMPORARY"},"url":"$url"}] "https://api.godaddy.com/v2/customers/$CustomerId/domains/forwards/$fqdn"

     

    {"code":"INVALID_BODY","fields":[{"code":"INVALID_BODY","message":"invalid character 'q' in literal false (expecting 'a')","path":"body"}],"message":"Request body doesn't fulfill schema, see details in `fields`"}

     

    What is the correct form of JSON here? Thanks for future answers

    1 ACCEPTED SOLUTION

    I solved the problem with making a data.json file that contains:

     

    {"fqdn":"$fqdn","mask":{"title":"$title"},"type":"MASKED","url":"$url"}

     

    and then access it,

     

    curl -i -X PUT -H "Authorization: sso-key $MY_KEY:$MY_SECRET" -H "Accept: application/json" -H "Content-Type: application/json" --data @data.json "https://api.godaddy.com/v2/customers/$CustomerId/domains/forwards/$fqdn"

    View solution in original post

    1 REPLY 1

    I solved the problem with making a data.json file that contains:

     

    {"fqdn":"$fqdn","mask":{"title":"$title"},"type":"MASKED","url":"$url"}

     

    and then access it,

     

    curl -i -X PUT -H "Authorization: sso-key $MY_KEY:$MY_SECRET" -H "Accept: application/json" -H "Content-Type: application/json" --data @data.json "https://api.godaddy.com/v2/customers/$CustomerId/domains/forwards/$fqdn"

    View solution in original post