Javascript API - createAssest edit_attributes syntax


(Martin) #1

Hi,


I am using the Javascript API and need some clarification on a function call.



Using the createAsset() function, how do I add a link attribute?



I am doing this, but it is not creating the attribute:



[font="Courier New"]createAsset(144213, 'link', 'Some title', 1, 'somelinkdescription','', '', '','"link_asset_id":"144000"', '', checkRepsonse);[/font]



Regards,

Martin


(Nic Hubbard) #2

Are you getting any errors in your error logs? Also, do you mean you are creating a link asset?


(Anthony Barnes) #3

I think your arguments might not be correctly given for that function. Try something like:

    
    createAsset(144213, 'link', 'Some title', 1, 'somelinkdescription',-1, 0, 0,1,'link_asset_id=144000', checkResponse);

(Martin) #4

[quote]
I think your arguments might not be correctly given for that function. Try something like:


    
    createAsset(144213, 'link', 'Some title', 1, 'somelinkdescription',-1, 0, 0,1,'link_asset_id=144000', checkResponse);

[/quote]



This worked, thanks! The documentation is a bit vague at this point. It would benefit from an example or two.


(Josh Sherwood) #5

[quote]
This worked, thanks! The documentation is a bit vague at this point. It would benefit from an example or two.

[/quote]



The documentation for the JS API has been updated to include examples for each function. Check them out here.


(Anthony Barnes) #6

Nice work Josh!


(Nic Hubbard) #7

Very nice! You guys are awesome!