Skip to main content
Participant
November 13, 2023
Answered

https://pdf-services-ue1.adobe.io/assets generating forbidden error 403 invalid client id

  • November 13, 2023
  • 1 reply
  • 1415 views

we have created credentials (server to server authentication) as  per te documentation and generated access token using rest api.

When trying to  generate upload presigned URI using rest api https://pdf-services-ue1.adobe.io/assets  using api key  generated in credentials we are getting forbidden error  http errocode 403 (error code: 403003) Clientid Id is invalid 

    This topic has been closed for replies.
    Correct answer ajay gunjal

    Your second auth header is wrong. It isn't X-API-KeyRequired, but X-API-Key.


    issue is resolved thank you very much

    1 reply

    Raymond Camden
    Community Manager
    Community Manager
    November 13, 2023

    Can you share some code showing how you are calling the API?

    Participant
    November 14, 2023

    the bove code in c++ using microsoft c++rest sdk

    std::string CWbssecurity::Adobeassetuploadid(std::string accesstoken, std::string clientid, std::string requestid)
    {
    std::shared_ptr<std::string> rtn = std::shared_ptr<std::string>(new std::string());

    try
    {

    std::string otpuri = "https://pdf-services.adobe.io/assets";


    utility::string_t otpuris = utility::conversions::to_string_t(otpuri);


    web::uri uri(utility::conversions::to_string_t(otpuris));
    web::uri_builder uri_builder(uri);
    web::http::client::http_client client(uri);
    web::http::http_request request2(web::http::methods::POST);

    std::string contype = "application/json";
    utility::string_t ctype = utility::conversions::to_string_t(contype);

    request2.headers().set_content_type(ctype);

    std::string auth = "Authorization";
    utility::string_t autht = utility::conversions::to_string_t(auth);
    std::string bearer = "Bearer " + accesstoken;
    request2.headers().add(autht, bearer.c_str());


    std::string apikey = "X-API-KeyRequired";
    utility::string_t apikeys = utility::conversions::to_string_t(apikey);
    request2.headers().add(apikeys, clientid.c_str());

     

    std::string payload;
    payload = "{\"mediatype\": \"application/pdf\"}";

    utility::string_t body = utility::conversions::to_string_t(payload);


    request2.set_body(body);
    client.request(request2).then([rtn](web::http::http_response response2)
    {

    *rtn = utility::conversions::to_utf8string(response2.extract_string(true).get());


    CString msg;
    msg.Format(_T("St: %d"), response2.status_code());
    AfxMessageBox((CString)rtn->c_str() + msg);

     

    }).wait();
    }
    catch (web::http::http_exception e)
    {
    AfxMessageBox((CString)(e.what()));
    }
    return(*rtn);
    }

    Raymond Camden
    Community Manager
    Community Manager
    November 14, 2023

    Your second auth header is wrong. It isn't X-API-KeyRequired, but X-API-Key.