Creating an activity alias returns either 404 or 400 - autodesk-forge

I have just created an activity with the name of InventorParams. I would like to add an alias as right now it shows up as: Guasamt.InventorParams+$LATEST in the activities list.
Now when POSTing the following request:
[
"id" => "prod"
]
Laravel will turn this into json. The Authorization header is also present
to https://developer.api.autodesk.com/da/us-east/v3/activities/:id/aliases. It either returns 400 or 404 errors. The 400 error is presented when using a fully qualified activity name. The 404 error is returned on all of the the following activity names:
Guasamt.InventorParams+LATEST (without $);
Guasamt.InventorParams;
InventorParams;
Now I'm wondering what should be the unqualified name of an activity?

When you create an Activity in FDA it gets a version number (since you just created it, it would be 1). This number needs to be used when creating Activity Alias, which is later used in the Work Item.
Your fully qualified name consist of <your_nick_name>.<activity_name>+<activity_version>. Where <your_nick_name> can be your ClientId if nickname was not specified.
Anyway I would recommend to follow the FDA tutorial. Another option on how to get quickly up to speed with FDA is to use the Autodesk Forge Tools addin to VS Code.

Related

Nifi LookupAttribute processor with SimpleCsvFileLookupService doesn't work

I'd like to use a CSV file as a lookup table to update some attributes.
So I figured the LookUpAttribute processor was what I needed. I configured it with as SimpleCsvFileLookupService as the Lookup Service, but I can't get it to work yet.
My SimpleCsvFileLookupService is configured but stays in a "enabling" state, and the LookUpAttribute processor still tells me it's "invalid because performing validation depends on referencing a Controller Service that is currently disabled".
I dont understand why it doesn't enable. Has somebody used these components ? Thx
Edit :
I didn't see the message in the left. It says the mapping for "1" is not found ("1" is set as the lookup key column and in the csv the header row is "1;2;3;4;5;6;7;8".
What am I missing ? I can't find any explanation as to how to use this controller service.
Edit2 : The SimpleCsvFileLookupService properties
Edit3 : Extract of the csv file

What is the URL when I DELETE an object

I'm running a local server playing around with an API using Django. I have a model called 'Users' populated with a few objects, and am using DefaultRouter.
I want to know what the URL would be if I were to DELETE a specific object from this model. For example, if I wanted to GET a user with an ID of 1 in this model, the URL would be: "localhost:8000/Users/1/". What would the equivalent be to DELETE this user?
I found an explanation of this on the REST API website (below), however, I don't understand what any of the syntaxes means.
What is {prefix}, {url_path}, {lookup} and [.format]? If anyone could provide an example of what this might be using a localhost that would be really helpful.
Thanks
Let us take an example of an API (URL) to update book data with id (pk) being 10. It would look something like this:
URL: http://www.example.com/api/v1/book/10/
Method: PUT/PATCH
With some data associated.
If you want to delete you just need to change method to DELETE instead of put or patch.
Regarding your second question lets compare the url with the parameters.
prefix: http://www.example.com/api/v1/book
lookup: 10
format: It specifies what type of data do you expect when you hit the API. Generally it is considered to be json.
url_path: In general, every thing after look up except query string is considered to be url_path.

How to include SR related work log long description when using maximo oslc rest api?

I am doing an HTTP GET request to /maximo/oslc/os/mxsr and using the oslc.select query string parameter to choose:
*,doclinks{*},worklog{*},rel.commlog{*},rel.woactivity{*,rel.woactivity{*}}
This lets me get related data, including related worklogs, but the worklog does not include the 'description_longdescription' field.
The only way I seem to be able to get that field is if I do a separate HTTP GET to query a worklog id directly through /maxrest/rest/mbo/worklog . Then it provides the description_longdescription field.
I understand this field is stored separately through the linked longdescription table, but I was hoping to get the data through the "next gen" oslc api with one http get request.
I've tried putting in 'worklog{*,description_longdescription}', as I read somewhere that longdescription is a "non-persistent" field and must be explicitly named for inclusion, but it had no effect.
I figured out that for the /maximo/oslc/os/mxsr object in the API, I needed to reference the related MODIFYWORKLOG object through the rel.modifyworklog syntax in the oslc.select query string:
oslc.select=*,doclinks{*},rel.modifyworklog{*,description_longdescription},rel.commlog{*},rel.woactivity{*,rel.woactivity{*}}
I also had to explicitly name the non-persistent field description_longdescription for it to be included.
Ref. for the "rel." syntax: https://developer.ibm.com/static/site-id/155/maximodev/restguide/Maximo_Nextgen_REST_API.html#_querying_maximo_asset_management_by_using_the_rest_api

get AppBundle by id design automation

So after successfully POSTing a new AppBundle, I cannot GET the details back anymore from https://developer.api.autodesk.com/da/us-east/v3/appbundles/:id. It results in a bad request 400
I'm using the fully qualified id, it's returned from the post as ClientId.name. Since there is no alias yet, there is no +label. I can do a GET on https://developer.api.autodesk.com/da/us-east/v3/appbundles and it will return my AppBundle with the +$LATEST label just fine. I tried appending that to the fully qualified id, or the version number, same result. I can GET existing (already shared) AppBundles just fine.
In case of non-shared app bundles, fully qualified ID must include the alias. Which means that in order to make the GET request, you will first need to create or update an alias that will point to the version that you have just created.

Box API: Get_managed_users returning all users

Using the Box 1.0 REST API, I am trying to work with the functions in SOAP UI.
The API doc for get_managed_users with user_id=12345 (internal id retrieved with get_user_id call correctly) is returning all the users. The docs say that would be the case if you do not specify a user_id value. But my full command is: (Token and API key changed to protect the clueless)
https://www.box.com/api/1.0/rest?user_id=27360&auth_token=blahbalhblah1234&action=get_managed_users&api_key=someKeyYouShouldNotSee
Now I could work with the complete result list, but that won't scale as we get thousands of users into the system.
I can make a call with edit_managed_user, using the same user_id value and the change is reflected in the UI, and in the next get_managed_users call. Thus I do have the correct user_id value, I would so assume.
I tried testuser#gmail.com as the user_id value as well, and get the entire list back. This leads me to believe that somehow I am sending user_id wrong, but I just do not see it.
Any hints? Why, with what seems like a valid user_id value is it acting like it is absent or incorrect?
Most likely you have either called this method with an invalid user_id, or one that is not in your set of managed users. Can you double check that the user comes back in your list of already managed users?