REST API not returning suppliers added after July 30

REST API not returning suppliers added after July 30

Anonymous
Not applicable
3,022 Views
18 Replies
Message 1 of 19

REST API not returning suppliers added after July 30

Anonymous
Not applicable

For some reason, The REST API is not returning any suppliers that have been added after July 30.  This seems to be the only unique characteristic about the suppliers it isn't returning.  Specifically, they all have the same set of permissions and have the same owner.

 

The number of suppliers returned by the API is 8 (plus two named "Autodesk" and "Autodesk 2" that aren't visible from the web client), but the number of suppliers visible on the web client are 15.

 

To say the least, I'm very puzzled as to why these don't get returned in the API response.

0 Likes
Accepted solutions (1)
3,023 Views
18 Replies
Replies (18)
Message 2 of 19

gasevsm
Alumni
Alumni
Tim, Are you using GET /workspace/{id}/items/?

Martin Gasevski | Fusion 360 Team Product Manager
0 Likes
Message 3 of 19

Anonymous
Not applicable
0 Likes
Message 4 of 19

gasevsm
Alumni
Alumni
Hmm... 1- Are all items active i.e. Not deleted? 2- Do you have the 'view items owned by others' permission? 3- I'm assuming this workspace is NOT rev-controlled workspace so you wouldn't need 'view working version' and 'view historical revisions' permissions. -- Martin Gasevski | Product Manager | Autodesk PLM 360

Martin Gasevski | Fusion 360 Team Product Manager
0 Likes
Message 5 of 19

Anonymous
Not applicable
  1. Yes.
  2. Yes.  But all these items are owned by me anyhow.
  3. This is a "Supplier Management with workflow" workspace, so no, it's not revision controlled.

I can see the suppliers just fine from the browser, but they aren't showing up in the responses to the API calls.

0 Likes
Message 6 of 19

gasevsm
Alumni
Alumni
Thank you Tim. Are the missing ones marked as Deleted/Archived by any chance? -- Martin Gasevski | Product Manager | Autodesk PLM 360

Martin Gasevski | Fusion 360 Team Product Manager
0 Likes
Message 7 of 19

Anonymous
Not applicable

No, they're all just normal items.  If I'm creating a new part manually from the browser, I can see all of the suppliers as options to select.

0 Likes
Message 8 of 19

gasevsm
Alumni
Alumni

Tim, your last post got me a bit confused. I assumed you are creating Supplier items and having trouble GET-ing supplier items list.  your last post suggests that you are creating some other item and wish to choose from a list of available suppliers to be added into a picklist for example on that item.  Can you clarify please. share imgs and callouts if have to add to the statement. thanks in advance,


Martin Gasevski | Fusion 360 Team Product Manager
0 Likes
Message 9 of 19

Anonymous
Not applicable

Sorry for the confusion.  You are correct.  I'm creating a "part" item and selecting a "supplier" item to attach to that "part" in the process.  From the browser, I have the supplier selection set up with a picklist so the user can select the supplier of that part from a drop down menu.  Therefore, from the API side, in order for me to specify the supplier to the API, I have to get the dmsID of the supplier I want to choose.  I am accomplishing this by getting the list of suppliers and finding the dmsID of the supplier with the same name as the one specified in the SolidWorks userform.  Since some, but not all, of the suppliers are being returned by the API, I have only recently started to have problems because all the parts from suppliers not being returned by the API I happened to have been adding manually, and all of the parts I've been adding via the API were from suppliers that were returned by the API.

0 Likes
Message 10 of 19

gasevsm
Alumni
Alumni
I see not to worry; this is all part of discovery. Does the picklists definition in PL Manager have filters that pre-removes some suppliers? Also what type of a PL field are you using in the parts workspace? In addition, try via postman calling the PL definition directly via this call. The online help > API resources > picklists > picklists/{picklistID} > GET is the page describing it all. GET api/rest/v1/setups/picklists/{picklistID} If this returns partial results then I'd suspect some filter added to it that scopes the supplier list to only qualified suppliers. -- Martin Gasevski | Product Manager | Autodesk PLM 360

Martin Gasevski | Fusion 360 Team Product Manager
0 Likes
Message 11 of 19

Anonymous
Not applicable

Well, that API call returns the full list, which I might be able to use; however, it wouldn't be quite as convenient as getting the list of items in the supplier workspace.  This is because although I said previously that I'm "finding the dmsID of the supplier with the same name as the one specified in the SolidWorks userform", I'm more specifically finding the supplier with a URL field that matches the domain of the source URL of the part being added to PLM.  This minimizes the number of inputs required in the SolidWorks userform.

 

Here is the code from my macro where I find the supplier:

 

 

With CreateObject("MSXML2.DOMDocument")
    .loadXML SuppHTTP
    
    'Derive supplier information based on the source URL
    Dim TempXML As MSXML2.DOMDocument, InSuppURL As String, _
        ind1 As Integer, ind2 As Integer
    
    InSuppURL = Split(UserFormImportPart.TextBoxSrcURL, "/")(2)
    For ind1 = 0 To .getElementsByTagName("item").Length - 1
        SuppID = .getElementsByTagName("id")(ind1).Text
        
        Set TempXML = CreateObject("MSXML2.DOMDocument")
        TempXML.loadXML .getElementsByTagName("item")(ind1).xml
        For ind2 = 0 To TempXML.getElementsByTagName("key").Length - 1
            If TempXML.getElementsByTagName("key")(ind2).Text = "NAME" Then
                SuppName = TempXML.getElementsByTagName("value")(ind2).Text
            ElseIf TempXML.getElementsByTagName("key")(ind2).Text = "URL" Then
                SuppURL = Split(TempXML.getElementsByTagName("value")(ind2).Text, "/")(2)
                If SuppURL = InSuppURL Then GoTo Bypass
            End If
        Next ind2
    Next ind1
    MsgBox "Supplier not found"
    Exit Sub
End With

Where SuppHTTP is the response from the request getting the list of items in the supplier workspace, UserFormImportPart.TextBoxSrcURL is the URL to the supplier's site for that part, and Bypass is the portion of code immediately following this that I want to skip to when I find the supplier URL that matches the one specified.

 

I guess at this point my options are as follows:

 

  1. Figure out why some of the suppliers are not being included in the response to the List workspace items API call but are being included in the response to the Retrieve picklist API call.
  2. Figure out how to create a picklist connecting the supplier's URL to its dmsID.
  3. Add an additional input to the SolidWorks userform for the user to explicitly specify the supplier.
  4. Create and maintain a local copy of the supplier list that mirrors the one in PLM.

Of those options, #2 sounds ideal since that would result in a smaller response from the API and less information to sift through; however, it looks like a picklist can connect the dmsID only to the corresponding item name, not to an arbitrary field from that item.  Option #3 would undoubtedly work, but it would require more input from the user, and I would like to avoid that if possible.  Similarly, option #4 would also work, but I'd also like to avoid having to update that list whenever a new supplier is added.

 

That leaves just option #1 and figuring out the source of the problem that led to this post.

 

Thanks for your help!  I greatly appreciate it!

 

0 Likes
Message 12 of 19

gasevsm
Alumni
Alumni
My recommendation is to open a support ticket so we find out what's behind the partial list generation. -- Martin Gasevski | Product Manager | Autodesk PLM 360

Martin Gasevski | Fusion 360 Team Product Manager
0 Likes
Message 13 of 19

Anonymous
Not applicable

I would love to be able to open a support ticket, but for some reason, no one on our end seems to have that capability even though I believe we are paying for it.  I've mentioned it here and in private messages and emails with @nguyentru and a few other Autodesk employees, but it's been more than a month since I have heard anything about the status of that.

 

To be clear, I know where I need to go to find the option to submit a support ticket, but when I go there, the option is missing.  The same is true for everyone in our organization.  Honestly, I haven't had the time to deal with it lately, so I haven't been staying on top of it as much as I should have.

0 Likes
Message 14 of 19

bastien.mazeran
Autodesk Support
Autodesk Support

Hello Tim,

 

I will be reaching out to you directly by email to walk you through the process of logging support tickets.

 

Regards,



Bastien Mazeran

Technical Support Specialist

0 Likes
Message 15 of 19

Anonymous
Not applicable
Okay. Sounds good. Thanks!
0 Likes
Message 16 of 19

nguyentru
Alumni
Alumni

Hi Tim,

 

I have reached out to the Support Team.

 

The same person that I had introduced to you last time will be in contact with you directly to help straighten the issue.

 

You can work directly with him to open any issue(s).

 

 

Thank you,

 

 

Trung

Trung Nguyen | PLM Product Management | Autodesk, Inc.
0 Likes
Message 17 of 19

Anonymous
Not applicable
Accepted solution

For anyone that comes here looking for the solution to this, it's actually quite simple.  I forgot that the default for this API call is to paginate the response and include only 10 items on the first page.  Therefore, if you merely specify that you want more items returned in the API call, it will give you more.  Here's the correct API call:

 

GET api/rest/v1/workspaces/14/items?page=1&size=100
Message 18 of 19

michelle.stone
Autodesk
Autodesk

Thanks for following up here with the solution - you'll save someone else some troubleshooting in the future.  Community at work!



Michelle Stone
Technical Marketing, PDM & PLM
Autodesk, Inc.
0 Likes
Message 19 of 19

gasevsm
Alumni
Alumni
HA~! Totally forgot asking about pagination. For one, simply because it was my understanding that default is 100 if not provided. Learn something new every day. Thanks for sharing. Wonder what online help states on this subject ;) -- Martin Gasevski | Product Manager | Autodesk PLM 360

Martin Gasevski | Fusion 360 Team Product Manager
0 Likes