Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

ContentAPI: Content SAVE is returning 401 error

bharathp
Contributor II

Hello,

I am trying to create/ update a record in Archer Applications table from Postman Application. I am able to obtain the Session ID and get the records from Applications table using the "Obtain Session ID" and "Get Level Metadata". When I tried the create/ update the same using Content Save, it is giving me 401 error.

Please find the details:

Method: POST

Endpoint: <archerURL>/contentapi/Applications

Headers: 

Content-Type: application/json

Cookie: ArcherSessionCookie={{sessionToken}}

Accept: application/json,text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

 

I've tried "__ArcherSessionCookie__", "Archer session-id" Let me know if I have to change anything.

12 REPLIES 12

BodieMinster
Archer Employee
Archer Employee

I was able to get an update working in my local instance using Fiddler, but I did see a few things that caused trouble.

  1. You have to use POST even if you're doing an update. This is different than the Platform API (and non-standard)
  2. If you send a non-unique value for a field that requires a unique value, you'll get an HTTP 400
  3. If you attempt to update a record that is participating in an Advanced Workflow, you may (depending on the workflow) get an HTTP 500

In none of these cases did I get a response that told me what was actually happening, as you would get in the Platform API. I would recommend the following approach:

  1. Test with a simple application that has no associated advanced workflow
  2. Reduce your update statement down to one or two fields
  3. Ensure those fields do not require unique values
  4. Try that update

If you can get that to succeed, you can increase the complexity until you find the point of failure. If you find something specific causing an issue, you can open a support case to get that addressed.

Bodie,

I am using POST method for the update.
Application ID is Unique. The body I am using is:

{
    "Applications_Id"112233,
    "Application_Manager": [
        "Lastname, FirstName"
    ]
}
want to know the exact endpoint and header (for session Cookie) I should be sending
 
Thanks,
Bharath

Your Authorization header should look like this

Authorization: Archer session-id=DF4B70880C7DA1CB32927C93658A7978

You'll have to call the /contentapi resource to get the available endpoints. 

What response are you getting?

When using Authorization: Archer session-id=DF4B70880C7DA1CB32927C93658A7978 as header getting 400. Refer Authorization.png

When using Cookie: ArcherSessionCookie= DF4B70880C7DA1CB32927C93658A7978, Getting 401. Refer Cookie.png

 

The Authorization header I sent included a session token from my environment. You'll need to replace the DF4B... value with your own session. 

Yes, I've done that. Replaced the session token with yours while posting the reply.

The session token I posted is only valid in my local environment. You will get an HTTP 401 unless you replace it with a session from the instance you are testing against.

Sorry, I meant that I've replaced the session token of yours with the SessionToken generated. I have replaced that in this post with your SessionToken.

I'd recommend a support ticket. They may be able to tell you why you're getting an HTTP 400.