Record not found when sending request

  • 1
  • Question
  • Updated 3 days ago
After getting access token, I was trying to create a sending request using https://api.rightsignature.com/public..., but all my requests get 404 Not Found status. The response shows: { "error": "Record not found" }
Photo of Sujan Pradhan

Sujan Pradhan

  • 11 Posts
  • 0 Reply Likes

Posted 2 weeks ago

  • 1
Photo of Saravanan Kannan

Saravanan Kannan, Software Engineer

  • 84 Posts
  • 12 Reply Likes
Hi Sujan,

Could you share your client application name? And also the exact request you are making? I will see if we can infer anything from the logs on our side.

Thanks
Saravanan
Photo of Sujan Pradhan

Sujan Pradhan

  • 9 Posts
  • 0 Reply Likes
This is the request I am making: https://api.rightsignature.com/public/v1/sending_requests

The body is
{
  "file": {
    "name": "my_upload.pdf",
    "source": "upload"
  },
  "document": {
    "signer_sequencing": false,
    "expires_in": 12,
    "name": "Sign me",
    "roles": [
      {
        "name": "test role",
        "signer_name": "Sujan",
        "signer_email": "spradhan@namicinsurance.com"
      }
    ]
  },
  "sending_request": {}
}

Photo of Sujan Pradhan

Sujan Pradhan

  • 9 Posts
  • 0 Reply Likes
The response just shows
{
"error": "Record not found"
}

It would be very helpful if it also shows which record with name or id not being found. Also the documentation in https://api.rightsignature.com/documentation/resources/v1/sending_requests/create.html does not explain this error.

Photo of Sujan Pradhan

Sujan Pradhan

  • 9 Posts
  • 0 Reply Likes
Here is the curl code snippet:

curl -X POST \
  https://api.rightsignature.com/public/v1/sending_requests \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Authorization: Bearer e89c2f4b12d15fafdd9c12aab4b7fdf029e936afa51eef45b6371402b64fd490' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Length: 359' \
  -H 'Content-Type: application/json' \
  -H 'Host: api.rightsignature.com' \
  -H 'Postman-Token: f1f17328-cda7-4cb5-b5dc-b9027f35fdef,d7f3fc62-75e6-4456-a9f1-848c8eac53ce' \
  -H 'User-Agent: PostmanRuntime/7.19.0' \
  -H 'cache-control: no-cache' \
  -d '{
  "file": {
    "name": "my_upload.pdf",
    "source": "upload"
  },
  "document": {
    "signer_sequencing": false,
    "expires_in": 12,
    "name": "Sign me",
    "roles": [
      {
        "name": "test role",
        "signer_name": "Sujan",
        "signer_email": "spradhan@namicinsurance.com"
      }
    ]
  },
  "sending_request": {}
}'
Photo of Saravanan Kannan

Saravanan Kannan, Software Engineer

  • 84 Posts
  • 12 Reply Likes
Sujan,

I have looked at the logs and I think it has something to do with the Authorization using the Bearer token, we are not able to find the Client Application. Could you give a try with basic authentication, 'Basic your_base64_encoded_private_token' for Authorization Header and see if it works? This will help us to confirm that Authorization really is the problem.

Thanks
Saravanan
Photo of Sujan Pradhan

Sujan Pradhan

  • 11 Posts
  • 0 Reply Likes
Saravanan,

I tried it but didn't work. It gave status 500 Internal Server Error. I am getting bearer token as below as per the instruction on https://api.rightsignature.com/documentation/resources/v1/oauth_tokens/create.html.

{
    "access_token": "e947d062564a1254412e8a210001e35af22754ac920b7810ed068e562fc562ff",
    "token_type": "Bearer",
    "expires_in": 5510,
    "scope": "read write",
    "created_at": 1573483359

}

Regards,
Sujan
Photo of Sujan Pradhan

Sujan Pradhan

  • 11 Posts
  • 0 Reply Likes
Hi Saravanan,

I tried to create the request using external IP too (with no firewall) to see if that is the issue, but still getting record not found error. I am really think I am missing something here which I have not been able to find out. I would really appreciate your help here.

Thanks,
Sujan
Photo of Saravanan Kannan

Saravanan Kannan, Software Engineer

  • 84 Posts
  • 12 Reply Likes
Sujan,

Did you get a chance to try with the authorization I have mentioned in the previous post? Using Basic and your base64 encoded private token? Please give it a try.
https://api.rightsignature.com/documentation/authentication


Thanks
Saravanan
Photo of Sujan Pradhan

Sujan Pradhan

  • 11 Posts
  • 0 Reply Likes
Yes I did. I didn't work. See my previous reply.
Photo of Sujan Pradhan

Sujan Pradhan

  • 11 Posts
  • 0 Reply Likes
I tried using Basic authorization. It didn't work. Please see my previous replies. Are you available to communicate online to help me resolve this issue? That would be more easier and quicker for me. I need to get this resolved asap.

Thanks for your help.

Regards,
Sujan
Photo of Saravanan Kannan

Saravanan Kannan, Software Engineer

  • 84 Posts
  • 12 Reply Likes
Sujan,

Could you try this simple request?

curl -X GET -i -H "Content-Type: application/hal+json" -H "Authorization: Basic your_base64_encoded_private_api_token" https://api.rightsignature.com/public/v1/me


You could find your private api token from your API client application page on RightSignature web app. You could use this to encode your token. https://www.base64encode.org/


Thanks
Saravanan

Photo of Sujan Pradhan

Sujan Pradhan

  • 11 Posts
  • 0 Reply Likes
It gives me 

{
    "status": 400,
    "error": "Bad Request"

}

Regards,
Sujan
Photo of Saravanan Kannan

Saravanan Kannan, Software Engineer

  • 84 Posts
  • 12 Reply Likes
Sujan,

If you are getting 400 that means something wrong in the request you are making.

Is this your client application NAMICO? I looked at the logs and I could not find any logs associated with this particular client app.

Thanks
Saravanan
Photo of Sujan Pradhan

Sujan Pradhan

  • 11 Posts
  • 0 Reply Likes
Yes, the client application is NAMICO. I wonder why there is no logs associated with it. I have been successfully able to authorize using my client ID and client secret generating access token. I think you should have some logs of those authorizations. 

Actually I am getting 400 record not found error when I tried this:

curl -X GET -i -H "Content-Type: application/hal+json" -H "Authorization: Basic your_base64_encoded_private_api_token" https://api.rightsignature.com/public/v1/me

When I try GET https://api.rightsignature.com/public/v1/me with Basic Auth using client ID and client secret, I get 

{
    "error": "unauthorized_client",
    "error_description": "The client application is not approved"

}

Does this help?

Regards,
Sujan
(Edited)
Photo of Sujan Pradhan

Sujan Pradhan

  • 11 Posts
  • 0 Reply Likes
Now, I am not getting response with bearer token using Basic Auth with client id and client secret as before with https://api.rightsignature.com/oauth/token

I get 401 unauthorized response as below:

{
    "error": "invalid_request",
    "error_description": "The request is missing a required parameter, includes an unsupported parameter value, or is otherwise malformed."
}

Please help.

Regards,
Sujan