Thanks for the quick reply. I wasn't able to find this doc, can you please send me the link?

Is it possible to ask you about another issue? Or should I open another ticket?
Basically when I try to edit the user template, when I hit the save button it keeps "saving", but it never saves.

Hi Kevin! I was digging a bit mor and I found a post of you where you mention the correct format of the JSON, example. I uploaded the demo image here: https://www.base64-image.de/ and put the code in the last part of the json but this wont work, Im not getting the ticket created!

"infraccion-pdf": [
{
"image.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+cAAAHuCAYAAAGKaU3LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAABl9BJREFUeNrsmnlUFEcex79zMeN6LfqIRrOJUaMGj+VFN+tBFlgjw8vqumbi9fCIGkW8I65HNIo8NSbeJoCKERQxEAIqEGDxgKjoilG5LxEHZHCGAYYRBnrO3uoeYH378ocYNSzU572e6umq/nV1fevX9fvNNEChUCgUCoVCoVAoFAqFQqFQKJQXiOAF2GT5D5bF8OHDkZeXR0f5txSY8MJFZzm1Ke1adCEdls4HFZ2KTukMiJ+3wTnH85+q3elPnFv3S+sYCMxWvOnUFYUllXj1jT6wqXOhxasoqqvCAFFXjHR+E9W6JtQ1meDk1A3dxFawBj3H9fot4ofesHgPbqg0gfXwWVi07oYp9fVzfthTVGjZAYQ5wSNsGeflWaNe3B/q51UKVBvZo3cQB8VO6Yuyee3gUvgRLE5qjBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEM/w/wAGX9BlkhCpNQAAAABJRU5ErkJggg=="
}
]

PS: on the example I removed characters because of the character limitation in the post.
PS2: using "attachments": [ this code works and I can see the uploaded image in the notes, but I want to load this in the custom field "infracciones-pdf"

    apipostman

    Here is the API Documentation:

    To upload files to custom fields you should be able to just use the Variable name of the field as the key and then format the data exactly as you would the regular attachments.

    As far as the template issue you’ll need to look at your web server error logs and PHP error logs for a related error.

    Cheers.

    Thanks Kevin! I believe I'm following your instructions, but the ticket is not created:

    {
    "alert": true,
    "autorespond": true,
    "source": "API",
    "name": "Angry User",
    "email": "api@osticket.com",
    "phone": "3185558634X123",
    "subject": "Testing API",
    "ip": "123.211.233.122",
    "message": "data:text/html,MESSAGE <b>HERE</b>",
    "infraccion-pdf": [
    {"image.png": "data:image/png;base64,R0lGODdhMAA..."},
    ]
    }

    Its gibing me 500 internal error:

    thanks

      apipostman

      Remove the trailing comma at the end of the attachment object. Also, check your error logs for any related errors.

      Cheers.

        apipostman

        Where was the field added? What form? Is that form attached to the help topic you are setting in the API request?

        Cheers.

        Kevin, first of all thank you so much for the support.

        This is the form with the custom field "infraccion-pdf"

        This is the help topic with ID 1:



        and here the help topic with the form:

        Anything else that could help understand this?

        apipostman

        You need to add "topicId": 1, to your JSON payload or set that help topic as the default help topic in your system settings.

        Cheers.

        apipostman

        Idk then, I’ll have to test on Monday to see. It’s basically saying that field isn’t available with the options you provided. So it’s likely disabled somewhere or not attached to the help topic or something.

        Cheers.

          9 days later
          Write a Reply...