Integrations and APIs for Service

Get Involved. Join the Conversation.

Topic

    Sathya Rajendran
    Error Code "OSC-CREST-00006" when using REST APIAnswered
    Topic posted December 10, 2018 by Sathya RajendranSilver Medal: 2,000+ Points, last edited December 10, 2018, tagged REST 
    80 Views, 8 Comments
    Title:
    Error Code "OSC-CREST-00006" when using REST API
    Content:

    Hello all,

    I am trying to create custom object using rest api and get OSC-CREST-00006 error.

    {type: "https://test.custhelp.com/services/rest/connect/exceptions/OSC-CREST-00006",…}
    detail: "Invalid type specified for property myobject.IncidentID"
    instance: "https://test.custhelp.com/services/rest/connect/v1.3/CO.VerificationDetails"
    o:errorCode: "OSC-CREST-00006"
    status: 400
    title: "An attempt to write a resource failed"
    type: "https://test.custhelp.com/services/rest/connect/exceptions/OSC-CREST-00006"

    Best Comment

    Sathya Rajendran

    Hi Vlad,

    i just modified the input as

    JSON.stringify({
                                                
                                                IncidentID: {
                                                id: 1342
                                                },                                            
                                                VarifiedAgent: {
                                                    id: 11
                                                }
                                                
                                            }),

    and its worked. But i have to give value for Yes/No field, any idea? i tried "1" and 1 but not working

    Comment

     

    • Vlad

      Hey Sathya,

      What JSON payload are you sending? What type of HTTP request are you making (e.g. GET, POST etc)?

      • Sathya Rajendran
        Hi Vlad,
        Thanks for your response. i am using POST request and below is my code.
        $.ajax({
                      url: globalContext.getInterfaceServiceUrl('rest')+'/connect/v1.3/CO.VerificationDetails',
                      method: "POST",
                      headers:{'Authorization':'Session '+sessionToken},
                      data: JSON.stringify({
                   
                    IncidentID: Incidentid,
        SkipVerification: 1,
        VarifiedAgent: acctID
                    }),
                      dataType: "json"
                    });
    • Vlad

      Try capturing a Fiddler trace with the actual payload you send. Look for quote marks around the incident ID. Looks like Incidentid is a string in your case and the API expects an integer.

    • Vlad

      The only way to be sure is to look at the JSON payload you send. You can add some console logging or an alert to your JavaScript code to show the payload or use a client side web debugging tool like Fiddler to capture it.

      • Sathya Rajendran

        Hi Vlad,

        i just modified the input as

        JSON.stringify({
                                                    
                                                    IncidentID: {
                                                    id: 1342
                                                    },                                            
                                                    VarifiedAgent: {
                                                        id: 11
                                                    }
                                                    
                                                }),

        and its worked. But i have to give value for Yes/No field, any idea? i tried "1" and 1 but not working

    • Vlad

      Try true without quotes, that should work.