Error 500: Post Address

Hey, I'm getting a Server 500 error when I Post Address. This is happening on my server but also through the Web “Try It”.

x-content-type-options: nosniff

x-envoy-upstream-service-time: 170

strict-transport-security: max-age=31536000; includeSubDomains

Cache-Control: no-store, must-revalidate, no-cache

Date: Fri, 28 Oct 2022 16:50:22 GMT

Content-Length: 131

Content-Type: application/json; charset=utf-8


{
"errors": [{
"error_code": 500,
"error_name": "Server Error",
"raw_message": "The service is currently unavailable, please try again."
}]
}

Also: In the Sky API documentation it doesn't show the line_one to be a required field but it is.

Comments

  • Tom Sisson
    Tom Sisson Blackbaud Employee
    Ninth Anniversary Participant Facilitator 1 Loyalty Badge

    @Kyle McMullin
    Without seeing your POST request body it is difficult to know exactly what might have caused this but doing my own digging it could be that you're missing the "country" property. Leaving country off of the request body results in a 500 for me. Adding a blank country results in a 400 with an appropriate message. Finally, adding "country": "United States" results in a 200 response for me. Let me know if this fixes your issue.

    There is a good deal of logic behind this endpoint. It is evident that we missed a few checks and that we haven't documented it correctly. We will look into updating the documentation and logic for this soon.

  • @Tom Sisson

    You were correct it was the “country” field in the body that it needed. Although it did bring up another error. It wouldn't let me set the “primary” or “mailing_address” field. If either of those fields were set I got a “Request body was not valid. was not valid.”

    i.e.

    This worked.
    {'type_id': 1744, 'user_id': 7582786, 'country': 'Canada', 'line_one': '123 Test Road', 'city': 'Cobble Hill', 'province': 'British Columbia'}

    This didn't.
    {'type_id': 1744, 'user_id': 7582786, 'country': 'Canada', 'line_one': '123 Test Road', 'mailing_address': True, 'city': 'Cobble Hill', 'province': 'British Columbia'}

    {"errors":[{"message":"Request body was not valid. was not valid.","error_code":400,"error_name":"Request body was not valid. was not valid.","raw_message":""}]}

  • @Tom Sisson

    Since you've been so helpful Tom, maybe you can take a look at the post phone number?

    body = {'number': '5555555555', 'type_id': 3011}

    {"errors":[{"error_code":500,"error_name":"Server Error","raw_message":"The service is currently unavailable, please try again."}]}


    body = {'number': '5555555555', 'type_id': 3007}

    {"errors":[{"error_code":500,"error_name":"Server Error","raw_message":"The service is currently unavailable, please try again."}]}

  • Tom Sisson
    Tom Sisson Blackbaud Employee
    Ninth Anniversary Participant Facilitator 1 Loyalty Badge

    @Kyle McMullin
    The POST users address create "mailing_address" property is a boolean and that value needs to be lowercase: "mailing_address": true

    It looks like the POST user phone needs at least an empty links object like the following:
    {"number": "5555555555", "type_id": 1714, "links": [ { } ] }

  • @Tom Sisson

    Hey Tom, the good news is that the empty link property worked for the POST phone.

    Unfortunately using true instead of True isn't going to work. True is not a valid Boolean in Python.
    x = true
    print(x)
    Traceback (most recent call last):

    File "./prog.py", line 1, in <module>
    NameError: name 'true' is not defined

    x = True
    print(x)
    True

    On a whim I tried to substitute a string “true” and “false” and that worked.
    'primary': 'true', 'mailing_address': 'true'

    As you can imagine a string with “true” or “false” as the value is not the same as a Boolean value of True or False and I'm sure that wasn't the intent of the programmer or project manger and the documentation indicates that. If someone on my team did that I would sit him in the corner for a timeout.

    In addition to that, it looks like if its the only address you are adding to an account you can't set the ‘primary’ to “false”.

Categories