Skip to content

API module - Conversation #2103

Description

@Fearofthedark66

Hi,

I just installed the API module and tried to add a conversation with the following javascript sample I found in the API documentation.


function newTicket(){
const url = new URL("https://hxsystem.se/api/conversations");


let headers = {
    "X-FreeScout-API-Key": "xxxxxxxxxxxxxxxx",
    "Content-Type": "application/json",
    "Accept": "application/hal+json",
}
let body = {
    "type": "email",
    "mailboxId": 1,
    "subject": "Hi there",
    "customer": {
        "email": "mark@example.org"
    },
    "threads": [
        {
            "text": "This is the message from a user",
            "type": "message"
            
        }
    ],
    "imported": true,
   
    
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
}

Problem is that it throws the following error: "message":"subject parameter is required"

What can cause this? I am trying to add a conversation from my localhost to my production, is that the issue?

Regards, Joakim

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions