Post

2 followers Follow
0
Avatar

Complex REST request in URL format

Due to the limitation of the system that I am working on, I have to convert the following into URL format for /data/createFromTemplate:


{
"templateName": "Program Tempate Rev4 2015-05-13",
"entity": {
        "Id": "/Project",
        "Name": "9998 Program"
           }
}

 

Used the following:

 

/data/createFromTemplate?templateName=Program Tempate Rev4 2015-05-13&entity.Id=/Project&entity.Name=9998 Program

Got error message:

"message": "Missing argument: Entity"

 

How do I compose the correct URL for this?

 

Thank you.

Bo Gao Answered

Please sign in to leave a comment.

2 comments

0
Avatar

Hi Bo,

REST API in general (not Clarizen's particularly) requires usage of HTTP methods other than GET.

CreateFromTemplate expects POST method (says the documentation).GET may work here, but I can't guarantee it.

Anyway, the entity parameter has to stay as it is, i.e. entity={"Id": "/Project","Name": "9998 Program"} as JSON representation of entity object. You can't just use the properties.
You may also need to URL encode that input.

Hope this helps,

Ophir

Ophir Kenig 0 votes
Comment actions Permalink