Skip to content

Opprette tomt skjema for preutfylling gir 500-feil #195

@Sigve-Fast

Description

@Sigve-Fast

Prøver å opprette et tomt skjema som beskrevet her: https://altinn.github.io/docs/api/rest/meldinger/sende-inn/#post-for-å-opprette-preutfylt-skjema , men dette ender i en 500-feil uten noen info om hva som gikk galt. Henting av meldinger får jeg til. Hva gjør jeg galt?

const payload = 
{
    "Type": "FormTask",
    "ServiceCode": "4927",
    "ServiceEdition": 1,
    "_embedded": {
    }
};

fetch('https://www.altinn.no/api/my/messages?complete=false', {
    method: 'POST',
    credentials: 'include',
    headers: {
        'Content-Type': 'application/hal+json',
        'Accept': 'application/hal+json',
        'ApiKey': 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
    },
    body: JSON.stringify(payload) // body data type must match "Content-Type" header
})

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions